Hello,
this is the patch to add support for WMI queries in Zabbix Agent. It will add "wmi.get" key. I have tested it only with Win32 agent, no support for x64 so far.
Parameters:
1 - mandatory. WMI root. for example: root\cimv2
2 - mandatory. WMI query. for example: select * from Win32_DiskDrive where Name like '%PHYSICALDRIVE0%'
3 - mandatory. Property to return. for example: Status
4 - optional. Data type to convert value into. Supported types are: int64 and text . This is needed because WMI sometimes returns numeric values as text.
Some examples where it can be used:
Get status of the physical disk:
wmi.get[root\cimv2,select * from Win32_DiskDrive where Name like '%PHYSICALDRIVE0%',Status]
Get status of the NLB cluster member:
wmi.get[root\microsoftnlb,select StatusCode from MicrosoftNLB_Node,StatusCode]