[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:
6
main.go
6
main.go
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user