目录

windows-exporter 监控

windows-exporter 监控安装

windows_exporter

下载安装

启动

下载 msi 版本,输入一下命令启动

1
msiexec /i C:\Users\Administrator\Downloads\windows_exporter.msi ENABLED_COLLECTORS="ad,iis,logon,memory,process,tcp,scheduled_task" TEXTFILE_DIR="C:\custom_metrics\"

卸载

1
msiexec /uninstall C:\Users\Administrator\Downloads\windows_exporter.msi

添加 prometheus 监控

prometheus.yaml

1
2
3
4
5
# 新增 windows-exporter
- job_name: "windows-exporter"
  file_sd_configs:
    - files:
        - "./file_sd/windows-exporter.yaml"

./file_sd/windows-exporter.yaml

1
2
3
4
# 新增 windows-exporter
- targets: ["192.168.0.6:9182"]
  labels:
    instance: windows-task

添加 alertmanager 告警

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# 告警信息
groups:
  - name: sanjiang windows 任务计划程序告警
    rules:
      - alert: windows实例任务告警
        expr: windows_scheduled_task_state{state="disabled",task=~"/ETL_kettle_tasks/.*"}==1
        for: 30s
        labels:
          severity: critical
          target: "{{$labels.job}}"
        annotations:
          summary: "sanjiang: {{$labels.job}} windows 任务异常"
          description: "{{$labels.task}} of job {{$labels.job}} 该任务断联已超过1分钟"