• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

kubernetes-基于Prometheus和Grafana监控Windows操作系统(wmi-exporter)

k8s 搞java代码 3年前 (2022-05-13) 13次浏览 已收录 0个评论
文章目录[隐藏]

1、安装和配置wmi-exporter

1.1 使用helm安装redis-exporter

通过下面的连接:https://github.com/martinlindhe/wmi_exporter/releases/download/v0.10.2/wmi_exporter-0.10.2-amd64.exe

下载wmi_exporter-0.10.2-amd64.exe,并将名称改为wmi_exporter.exe。在本文中,将wmi_exporter.exe放置在”d:”目录下,通过执行下面的命名将wmi_exporter.exe注册成windows系统服务。

sc create wmi_exporter binpath= "d:wmi_exporter.exe" start= auto

www#gaodaima.com来源gao@daima#com搞(%代@#码@网搞代码

1.2 查看Windows操作系统的指标数据

在浏览器中访问:http://{ip}:9182,能够看到所要监控的指标。

2、Prometheus监控

2.1 配置Prometheus

在Prometheus的配置文件(Prometheus.yaml)中,添加红色字体部分的内容。

global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).

# Alertmanager configuration
alerting:
alertmanagers:
– static_configs:
– targets:
# – alertmanager:9093

# Load rules once and periodically evaluate them according to the global ‘evaluation_interval’.
rule_files:
# – “first_rules.yml”
# – “second_rules.yml”

# A scrape configuration containing exactly one endpoint to scrape:
# Here it’s Prometheus itself.
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
– job_name: ‘prometheus’

# metrics_path defaults to ‘/metrics’
# scheme defaults to ‘http’.

static_configs:
– targets: [‘localhost:9090’]

# 配置从redis-exporter中获取数据,目标地址为:10.0.32.148:9182

– job_name: ‘windows-node-001’
static_configs:
– targets: [‘10.0.32.148:9182’]

2.2 配置验证

在浏览器的地址栏访问http://{prometheus}/targets,将会看到新配置的redis。

3 Grafana监控

3.1 配置Windows监控dashboard

下载wmi-exporter的dashboard(windows-host-metrics_rev1.json),下载地址:https://grafana.com/api/dashboards/10171/revisions/1/download/

在grafana中导入dashboard:windows-host-metrics_rev1.json。

导入后,通过此dashborad,管理员就可以监控Windows操作系统的CPU、内存、磁盘空间、网络等性能指标。

 

作者简介:

季向远,北京神舟航天软件技术有限公司。本文版权归原作者所有。微博:ik8s


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:kubernetes-基于Prometheus和Grafana监控Windows操作系统(wmi-exporter)

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址