if you need to collect windows wmi metrics and publish it to EM through EPAgent you will find the attached plugin helpful. This plugin runs as a statefull epagent that continuously queries for WMI metrics. The WMI metrics can be specified using the XML file. The xml gives you lot of flexibility by allowing you to specify data type, multiple instance of the counter etc. With the ability to specify data type it gives lot flexibility in aggregation.
Here is a sample wmi counter that you can specify in xml file
<WilyMetricName>% Free Space</WilyMetricName>
<CounterPath>\LogicalDisk(*)\% Free Space</CounterPath>
<Description>Windows disk metric with multiple instances</Description>
The plugin is written in Powershell.
deploy the agent under c:\EPAgent and make following changes to properties file
introscope.epagent.stateful.POWERSHELL.command=powershell -File C:\\EPAgent\\epaplugins\\windows\\WMI\\WindowsEPAPlugin.ps1
its been tested for 9.5,9.6,9.7
If you find any issue pls make changes and upload it for others benefit
Hope you find it useful