1. 概述

微软系的产品其实我一直没怎么研究,主要是我个人非常喜欢开源产品,对于收费的产品基本没什么研究。这里说的不到位的地方希望大家谅解。

Windows的exporter很有意思,因为他不仅可以监控Windows系统本身,连上面一些常用的服务也可以监控起来,比如ad,sql-server,iis,hyperv,exchange, .NET信息等等

2. windows_exporter

和node_exporter类似,windows也是使用了collector的方式,默认打开一些选项,如果我们有额外要求再打开别的选项

2.1. Collectors

摘自官网

Name Description Enabled by default
ad Active Directory Domain Services  
adfs Active Directory Federation Services  
cpu CPU usage
cs “Computer System” metrics (system properties, num cpus/total memory)
container Container metrics  
dhcp DHCP Server  
dns DNS Server  
exchange Exchange metrics  
fsrmquota Microsoft File Server Resource Manager (FSRM) Quotas collector  
hyperv Hyper-V hosts  
iis IIS sites and applications  
logical_disk Logical disks, disk I/O
logon User logon sessions  
memory Memory usage metrics  
msmq MSMQ queues  
mssql SQL Server Performance Objects metrics  
netframework_clrexceptions .NET Framework CLR Exceptions  
netframework_clrinterop .NET Framework Interop Metrics  
netframework_clrjit .NET Framework JIT metrics  
netframework_clrloading .NET Framework CLR Loading metrics  
netframework_clrlocksandthreads .NET Framework locks and metrics threads  
netframework_clrmemory .NET Framework Memory metrics  
netframework_clrremoting .NET Framework Remoting metrics  
netframework_clrsecurity .NET Framework Security Check metrics  
net Network interface I/O
os OS metrics (memory, processes, users)
process Per-process metrics  
remote_fx RemoteFX protocol (RDP) metrics  
service Service state metrics
system System calls
tcp TCP connections  
thermalzone Thermal information  
terminal_services Terminal services (RDS)  
textfile Read prometheus metrics from a text file
vmware Performance counters installed by the Vmware Guest agent  

2.2. 启动选项

如果想要启动某个选项,就使用--collectors.enabled,比如

.\windows_exporter.exe --collectors.enabled "service" --collector.service.services-where "Name='windows_exporter'"

启用二级选项,比如只监控firefox

.\windows_exporter.exe --collectors.enabled "process" --collector.process.whitelist="firefox.+"

以进程形式启动

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