Add health collector (#70)
* Add health collector for voltage & temperature * Run gofmt * Add help text to health collector
This commit is contained in:
7
main.go
7
main.go
@@ -41,6 +41,7 @@ var (
|
||||
withDHCP = flag.Bool("with-dhcp", false, "retrieves DHCP server metrics")
|
||||
withDHCPL = flag.Bool("with-dhcpl", false, "retrieves DHCP server lease metrics")
|
||||
withDHCPv6 = flag.Bool("with-dhcpv6", false, "retrieves DHCPv6 server metrics")
|
||||
withHealth = flag.Bool("with-health", false, "retrieves board Health metrics")
|
||||
withPOE = flag.Bool("with-poe", false, "retrieves PoE metrics")
|
||||
withPools = flag.Bool("with-pools", false, "retrieves IP(v6) pool metrics")
|
||||
withOptics = flag.Bool("with-optics", false, "retrieves optical diagnostic metrics")
|
||||
@@ -124,7 +125,7 @@ func loadConfigFromFlags() (*config.Config, error) {
|
||||
Address: *address,
|
||||
User: *user,
|
||||
Password: *password,
|
||||
Port: *deviceport,
|
||||
Port: *deviceport,
|
||||
},
|
||||
},
|
||||
}, nil
|
||||
@@ -198,6 +199,10 @@ func collectorOptions() []collector.Option {
|
||||
opts = append(opts, collector.WithDHCPv6())
|
||||
}
|
||||
|
||||
if *withHealth || cfg.Features.Health {
|
||||
opts = append(opts, collector.WithHealth())
|
||||
}
|
||||
|
||||
if *withPOE || cfg.Features.POE {
|
||||
opts = append(opts, collector.WithPOE())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user