Prometheus 采集Windows主机监控数据

Posted CIAS

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Prometheus 采集Windows主机监控数据相关的知识,希望对你有一定的参考价值。

Prometheus采集主机监控参考部署下载,图形生成

系统exporter 安装参考Grafana download
Windows参考图形生成参考win_exporter
Linux参考node_exporter
mysql参考Mysql_exporter
SQL Server参考SQL exporter
Redis 参考Redis_exporter
cadvisor参考cadvisor
rabbitmq参考参考rabbitmq

snmp_exporter

参考图形展示在测试中

snmp_exporter

zabbix集成参考

download exporter

  • wmi_exporter Windows操作系统采集(如CPU,内存,硬盘,网络等)
  • Windows 高版本建议安装最新的Windows_exporter
  • 采集端口9182 
  • 防火墙不要关闭,防火墙规整默认安装完成会自动创建
  • 批量部署到多台Windows主机参考

通过Powershell一键安装windows_exporter监控数据采集

powershell-install-windows_exporter-0.20.ps1
<# Powershell Install windows_exporter-0.20
+++++++++++++++++++++++++++++++++++++++++++++++++++++
+  _____                       _____ _          _ _ +
+ |  __ \\                     / ____| |        | | |+
+ | |__) |____      _____ _ _| (___ | |__   ___| | |+
+ |  ___/ _ \\ \\ /\\ / / _ \\ '__\\___ \\| '_ \\ / _ \\ | |+
+ | |  | (_) \\ V  V /  __/ |  ____) | | | |  __/ | |+
+ |_|   \\___/ \\_/\\_/ \\___|_| |_____/|_| |_|\\___|_|_|+
+ +++++++++++++++++++++++++++++++++++++++++++++++++++
                                                                                                              
# Powershell Install windows_exporter-0.20
# .\\powershell-install-windows_exporter-0.20.ps1
#> 

#windows_exporter-0.20
$windows_exporter = "windows_exporter-0.20.0-amd64.msi"
$url = "https://github.com/prometheus-community/windows_exporter/releases/download/v0.20.0/"
$drive = "D:\\"

Write-Host "download windows_exporter-0.20 up D dish" -ForegroundColor Green
wget -Uri $url/$windows_exporter -UseBasicParsing -OutFile $drive$windows_exporter

Write-Host "Install windows_exporter" -ForegroundColor Green 
Start-Process "D:\\$windows_exporter" -ArgumentList "-qn"  -wait

Write-Host "Delete the downloaded file" -ForegroundColor Green
rm $drive$windows_exporter 

Write-Host "Restart winRM the service" -ForegroundColor Green
Restart-Service winRM

执行一键安装

.\\powershell-install-windows_exporter-0.20.ps1

结果输出展示 

安装完成查看版本安装时间等等

  • 控制面板\\所有控制面板项\\程序和功能

自动生成的系统服务

  • 控制面板\\所有控制面板项\\管理工具\\服务

Prometheus 采集配置

scrape_configs:
  - job_name: 'web' 
    scrape_interval: 5s
    static_configs: 
      - targets: 
        - localhost:9090

  - job_name: 'Windows-Host-monitoring'
    scrape_interval: 5s
    static_configs:
      - targets: 
        - 192.168.11.63:9182

Grafana图形展示

Import>10467>Prometheus

以上是关于Prometheus 采集Windows主机监控数据的主要内容,如果未能解决你的问题,请参考以下文章

Prometheus 采集Linux主机监控数据

Prometheus 采集Linux主机监控数据

Prometheus 采集rabbitmq监控数据

Prometheus 采集rabbitmq监控数据

Prometheus 采集snmp监控数据

Prometheus 采集Mysql监控数据