added DHCPL collection to configs and collectors (#69)

This commit is contained in:
Steve Brunton 2020-02-03 22:00:00 -05:00 committed by GitHub
parent c00607abe0
commit 75b5f8be36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -13,6 +13,7 @@ type Config struct {
Features struct {
BGP bool `yaml:"bgp,omitempty"`
DHCP bool `yaml:"dhcp,omitempty"`
DHCPL bool `yaml:"dhcpl,omitemptu"`
DHCPv6 bool `yaml:"dhcpv6,omitempty"`
Routes bool `yaml:"routes,omitempty"`
POE bool `yaml:"poe,omitempty"`

View File

@ -39,6 +39,7 @@ var (
withBgp = flag.Bool("with-bgp", false, "retrieves BGP routing infrormation")
withRoutes = flag.Bool("with-routes", false, "retrieves routing table information")
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")
withPOE = flag.Bool("with-poe", false, "retrieves PoE metrics")
withPools = flag.Bool("with-pools", false, "retrieves IP(v6) pool metrics")
@ -189,6 +190,10 @@ func collectorOptions() []collector.Option {
opts = append(opts, collector.WithDHCP())
}
if *withDHCPL || cfg.Features.DHCPL {
opts = append(opts, collector.WithDHCPL())
}
if *withDHCPv6 || cfg.Features.DHCPv6 {
opts = append(opts, collector.WithDHCPv6())
}