prometheus+grafana监控Windows之wmi_exporter(三)
prometheus+grafana监控linux+windows之软件安装(二) (prometheus,grafana及插件,node-exporter,cadvisor,pushgateway,kafka-exporter,zookeeper-exporter,redis-exporter,wmi_exporter,Alertmanager)一、监控Windows客户端wmi_export.
·
prometheus+grafana监控Windows之wmi_exporter(三)
一、监控Windows客户端wmi_exporter(9182端口)
下载地址:https://github.com/martinlindhe/wmi_exporter/releases
我使用的版本是msi
放到Windows任意目录,双击安装即可,安装路径为C:\Program Files\wmi_exporter
安装完成后访问WindowsIP:9182或WindowsIP:9182/metrics
能访问就安装成功
二、wmi监控之常用promQL
注:$server为模板变量,下面sql中key对应的value值请根据自己实际值来填写
运行时间
wmi_os_time{instance=~"$server"} - wmi_system_system_up_time{instance=~"$server"}
内存
wmi_cs_physical_memory_bytes{instance=~"$server"}
CPU使用率
100 - (avg by (instance) (irate(wmi_cpu_time_total{mode="idle", instance=~"$server"}[5m])) * 100)
内存使用率
(wmi_cs_physical_memory_bytes{instance=~"$server"} - wmi_os_physical_memory_free_bytes{instance=~"$server"}) / wmi_cs_physical_memory_bytes{instance=~"$server"} * 100
磁盘使用率
(sum(wmi_logical_disk_size_bytes{volume!~"Harddisk.*", instance="$server"}) by (instance) - sum(wmi_logical_disk_free_bytes{volume!~"Harddisk.*", instance="$server"}) by (instance)) / sum(wmi_logical_disk_size_bytes{volume!~"Harddisk.*", instance="$server"}) by (instance) * 100
带宽使用率
sum(irate(wmi_net_bytes_total{instance=~"$server",nic=~"Red_Hat_VirtIO_Ethernet_Adapter.*"}[1m])) / sum(wmi_net_current_bandwidth{instance=~"$server",nic=~"Red_Hat_VirtIO_Ethernet_Adapter.*"}/8) * 100
磁盘I/O操作总数
rate(wmi_logical_disk_split_ios_total{instance=~"$server", volume !~"HarddiskVolume.+"}[30s])
进程数
wmi_os_processes{instance=~"$server"}
磁盘剩余空间
wmi_logical_disk_free_bytes{instance=~"$server", volume !~"HarddiskVolume.+"}
三、监控效果展示
更多推荐
已为社区贡献1条内容
所有评论(0)