[ci skip] monitor data for ethernet ports (#45)

* fix import name conflict
* adding in ethernet monitor information via prometheus gauge
* set CGO_ENABLED env var on build
This commit is contained in:
Steve Brunton
2019-08-20 22:11:03 -04:00
committed by GitHub
parent ea9cc69a3a
commit beb09ce540
6 changed files with 141 additions and 4 deletions

View File

@@ -36,6 +36,7 @@ var (
withOptics = flag.Bool("with-optics", false, "retrieves optical diagnostic 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")
timeout = flag.Duration("timeout", collector.DefaultTimeout, "timeout when connecting to devices")
tls = flag.Bool("tls", false, "use tls to connect to routers")
insecure = flag.Bool("insecure", false, "skips verification of server certificate when using TLS (not recommended)")
@@ -190,6 +191,11 @@ func collectorOptions() []collector.Option {
opts = append(opts, collector.WithWlanIF())
}
if *withMonitor || cfg.Features.Monitor {
opts = append(opts, collector.Monitor())
}
if *timeout != collector.DefaultTimeout {
opts = append(opts, collector.WithTimeout(*timeout))
}