下載exporter:
https://github.com/martinlindhe/wmi_exporter
在windows服務執行:
.\wmi_exporter-0.11.1-amd64.exe --collector.service.services-where="Name LIKE 'MySql%' or Name='RemoteRegistry'"
可以將其註冊成服務隨windows系統啓動自動啓動
官網上有個例子使用msi文件安裝成服務,並設置擴展參數。但是在我的服務器上執行不成功(使用cmd執行時不成功,沒有使用powershell測試)。
msiexec /i <path-to-msi-file> ENABLED_COLLECTORS=os,service --% EXTRA_FLAGS="--collector.service.services-where ""Name LIKE 'sql%'"""
所以我是通過其它方式將其註冊成windows服務的,參見另外一篇博客。