网站首页 > 精选文章 / 正文
我们使用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
猜你喜欢
- 2025-03-18 Promethus配置邮件告警(prometheus配置文件中rule_files参数)
- 2025-03-18 k8s集群资源监控(k8s集群监控方案)
- 2025-03-18 第05期:使用 普罗米修斯 监控 clickhouse 集群
- 2025-03-18 prometheus网络监控之fping-exporter
- 2025-03-18 6个步骤搞定云原生应用监控和告警(建议收藏)
- 2025-03-18 轻松驾驭!Prometheus 如何监控指标,快速定位故障?
- 2025-03-18 搭建服务端性能监控系统 Prometheus 详细指南
- 2025-03-18 OpenTelemetry 实战:从零实现应用指标监控
- 2025-03-18 Prometheus:监控系统保姆级指南(prometheus监控原理)
- 2025-03-18 DeepFlow 最佳实践 —— 主机指标数据集成及统一观测