windows_exporter/tools/collector-generator
Ben Reedy 7886cf9e37
chore(deps): Update wmi to v1.2.2
This includes a move from github.com/StackExchange/wmi to
github.com/yusufpapurcu/wmi, as the StackExchange repository has been
archived.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2023-03-12 17:34:34 +10:00
..
collector.template chore(deps): Update wmi to v1.2.2 2023-03-12 17:34:34 +10:00
generate-collector.go Lint-fix: varcheck 2019-01-23 09:56:24 +01:00
New-Collector.ps1 feat: adapting to support CimSession and alternative namespaces 2022-06-19 18:40:28 +10:00
README.md Add a collector generator script 2016-09-24 20:55:40 +02:00

Collector generator

Generates a collector skeleton implementation from a WMI class.

Usage

Build the generator:

go build .

Run the script to query the WMI service and send the output to the generator:

.\New-Collector.ps1 -Class Win32_PerfRawData_PerfOS_Processor

This will generate a collector. The collector name is generated by first removing Win32_PerfRawData_Perf and lower-casing, so Win32_PerfRawData_PerfOS_Processor will generate os_processor.go. This can be overridden by passing -CollectorName to the script.