mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-03-02 16:46:35 +00:00
Add a collector generator script
This commit is contained in:
17
tools/collector-generator/README.md
Normal file
17
tools/collector-generator/README.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# Collector generator
|
||||
Generates a collector skeleton implementation from a WMI class.
|
||||
|
||||
## Usage
|
||||
Build the generator:
|
||||
|
||||
```bash
|
||||
go build .
|
||||
```
|
||||
|
||||
Run the script to query the WMI service and send the output to the generator:
|
||||
|
||||
```powershell
|
||||
.\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.
|
||||
Reference in New Issue
Block a user