mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-10-17 10:09:05 +02:00
wmi: add generic wmi collector (#2530)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
a67a64c55c
commit
88034b818e
@@ -77,6 +77,7 @@ import (
|
||||
"github.com/prometheus-community/windows_exporter/internal/collector/udp"
|
||||
"github.com/prometheus-community/windows_exporter/internal/collector/update"
|
||||
"github.com/prometheus-community/windows_exporter/internal/collector/vmware"
|
||||
"github.com/prometheus-community/windows_exporter/internal/collector/wmi"
|
||||
"github.com/prometheus-community/windows_exporter/internal/mi"
|
||||
"github.com/prometheus-community/windows_exporter/internal/pdh"
|
||||
"github.com/prometheus-community/windows_exporter/internal/types"
|
||||
@@ -149,6 +150,7 @@ func NewWithConfig(config Config) *Collection {
|
||||
collectors[udp.Name] = udp.New(&config.UDP)
|
||||
collectors[update.Name] = update.New(&config.Update)
|
||||
collectors[vmware.Name] = vmware.New(&config.Vmware)
|
||||
collectors[wmi.Name] = wmi.New(&config.WMI)
|
||||
|
||||
return New(collectors)
|
||||
}
|
||||
|
||||
@@ -67,6 +67,7 @@ import (
|
||||
"github.com/prometheus-community/windows_exporter/internal/collector/udp"
|
||||
"github.com/prometheus-community/windows_exporter/internal/collector/update"
|
||||
"github.com/prometheus-community/windows_exporter/internal/collector/vmware"
|
||||
"github.com/prometheus-community/windows_exporter/internal/collector/wmi"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
@@ -119,6 +120,7 @@ type Config struct {
|
||||
UDP udp.Config `yaml:"udp"`
|
||||
Update update.Config `yaml:"update"`
|
||||
Vmware vmware.Config `yaml:"vmware"`
|
||||
WMI wmi.Config `yaml:"wmi"`
|
||||
}
|
||||
|
||||
// ConfigDefaults Is an interface to be used by the external libraries. It holds all ConfigDefaults form all collectors
|
||||
@@ -175,4 +177,5 @@ var ConfigDefaults = Config{
|
||||
UDP: udp.ConfigDefaults,
|
||||
Update: update.ConfigDefaults,
|
||||
Vmware: vmware.ConfigDefaults,
|
||||
WMI: wmi.ConfigDefaults,
|
||||
}
|
||||
|
||||
@@ -71,6 +71,7 @@ import (
|
||||
"github.com/prometheus-community/windows_exporter/internal/collector/udp"
|
||||
"github.com/prometheus-community/windows_exporter/internal/collector/update"
|
||||
"github.com/prometheus-community/windows_exporter/internal/collector/vmware"
|
||||
"github.com/prometheus-community/windows_exporter/internal/collector/wmi"
|
||||
)
|
||||
|
||||
func NewBuilderWithFlags[C Collector](fn BuilderWithFlags[C]) BuilderWithFlags[Collector] {
|
||||
@@ -130,6 +131,7 @@ var BuildersWithFlags = map[string]BuilderWithFlags[Collector]{
|
||||
udp.Name: NewBuilderWithFlags(udp.NewWithFlags),
|
||||
update.Name: NewBuilderWithFlags(update.NewWithFlags),
|
||||
vmware.Name: NewBuilderWithFlags(vmware.NewWithFlags),
|
||||
wmi.Name: NewBuilderWithFlags(wmi.NewWithFlags),
|
||||
}
|
||||
|
||||
// Available returns a sorted list of available collectors.
|
||||
|
||||
Reference in New Issue
Block a user