collect firmware version (#82)
collect packages/firmware versions and export them as labels for gauge under : mikrotik_system_package * updated versions of dependent libs * fetch firmware version as gauge * fixed the things that needed to be fixed
This commit is contained in:
33
main.go
33
main.go
@@ -36,20 +36,21 @@ var (
|
||||
user = flag.String("user", "", "user for authentication with single device")
|
||||
ver = flag.Bool("version", false, "find the version of binary")
|
||||
|
||||
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")
|
||||
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")
|
||||
withW60G = flag.Bool("with-w60g", false, "retrieves w60g interface metrics")
|
||||
withWlanSTA = flag.Bool("with-wlansta", false, "retrieves connected wlan station metrics")
|
||||
withWlanIF = flag.Bool("with-wlanif", false, "retrieves wlan interface metrics")
|
||||
withMonitor = flag.Bool("with-monitor", false, "retrieves ethernet interface monitor info")
|
||||
withIpsec = flag.Bool("with-ipsec", false, "retrieves ipsec metrics")
|
||||
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")
|
||||
withFirmware = flag.Bool("with-firmware", false, "retrieves firmware versions")
|
||||
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")
|
||||
withW60G = flag.Bool("with-w60g", false, "retrieves w60g interface metrics")
|
||||
withWlanSTA = flag.Bool("with-wlansta", false, "retrieves connected wlan station metrics")
|
||||
withWlanIF = flag.Bool("with-wlanif", false, "retrieves wlan interface metrics")
|
||||
withMonitor = flag.Bool("with-monitor", false, "retrieves ethernet interface monitor info")
|
||||
withIpsec = flag.Bool("with-ipsec", false, "retrieves ipsec metrics")
|
||||
|
||||
cfg *config.Config
|
||||
|
||||
@@ -199,6 +200,10 @@ func collectorOptions() []collector.Option {
|
||||
opts = append(opts, collector.WithDHCPv6())
|
||||
}
|
||||
|
||||
if *withFirmware || cfg.Features.Firmware {
|
||||
opts = append(opts, collector.WithFirmware())
|
||||
}
|
||||
|
||||
if *withHealth || cfg.Features.Health {
|
||||
opts = append(opts, collector.WithHealth())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user