Add health collector (#70)

* Add health collector for voltage & temperature
* Run gofmt
* Add help text to health collector
This commit is contained in:
Ben Reedy
2020-02-10 18:55:10 +00:00
committed by GitHub
parent 8578c271bb
commit 3b33400d24
6 changed files with 116 additions and 6 deletions

View File

@@ -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())
}