MySQL, Oracle, Linux, 软件架构及大数据技术知识分享平台

网站首页 > 精选文章 / 正文

Prometheus之监控Windows主机(prometheus windows监控)

2025-03-18 22:57 huorong 精选文章 1 ℃ 0 评论

我们使用Node Exporter来监控linux平台的主机,如果想监控Windows平台通过WMI Exporter来完成。

安装WMI Export

Windows Exporter官方说明和下载地址分别是:

https://github.com/prometheus-community/windows_exporter#collectors

https://github.com/prometheus-community/windows_exporter/releases

下载 msi格式并且安装:


安装完成后检查windows 服务


WMI Exporter 的监听端口是9182:


抓取Windows Exporter

如同抓取Node Exporter,为了抓取WMI Exporter我们需要修改Prometheus配置文件.

要获取新数据,需要为prometheus.yml添加另外一个新的job,新的配置文件如下:

root@prometheous:/etc/prometheous#cat prometheus.yml 
# my global config
global:
  scrape_interval:     5s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 5s # Evaluate rules every 15 seconds. The default is every 1 minute.
alerting:
  alertmanagers:
  - static_configs:
    - targets:
rule_files:
scrape_configs:
  - job_name: 'prometheus'
    static_configs:
    - targets: ['localhost:9090']
  - job_name: 'linux_node'
    static_configs:
    - targets: ['10.110.204.54:9100']
      labels:
        group: 'production'
    params:
     collect[]:
     - cpu
     - meminfo
     - diskstats
     - netdev
     - netstat
     - filesystem
  - job_name: 'windows_node'
    static_configs:
    - targets: ['10.110.156.67:9182']
      labels:
        group: 'production'

重新加载prometheus.yml文件:

root@prometheous:~/prometheous# prometheus --config.file /etc/prometheous/prometheus.yml &

使用PromQL

我们可以通过在浏览器上查看Target状态并运行相关的PromQL



Tags:scrape_interval

控制面板
您好,欢迎到访网站!
  查看权限
网站分类
最新留言