mirror of
https://github.com/nshttpd/mikrotik-exporter.git
synced 2025-02-07 23:31:35 +01:00
updated some descriptions and log output
This commit is contained in:
parent
2c3eaf66cd
commit
08497c66da
@ -35,13 +35,13 @@ const (
|
|||||||
var (
|
var (
|
||||||
scrapeDurationDesc = prometheus.NewDesc(
|
scrapeDurationDesc = prometheus.NewDesc(
|
||||||
prometheus.BuildFQName(namespace, "scrape", "collector_duration_seconds"),
|
prometheus.BuildFQName(namespace, "scrape", "collector_duration_seconds"),
|
||||||
"mikrotik_exporter: duration of a collector scrape",
|
"mikrotik_exporter: duration of a device collector scrape",
|
||||||
[]string{"device"},
|
[]string{"device"},
|
||||||
nil,
|
nil,
|
||||||
)
|
)
|
||||||
scrapeSuccessDesc = prometheus.NewDesc(
|
scrapeSuccessDesc = prometheus.NewDesc(
|
||||||
prometheus.BuildFQName(namespace, "scrape", "collector_success"),
|
prometheus.BuildFQName(namespace, "scrape", "collector_success"),
|
||||||
"mikrotik_exporter: whether a collector succeeded",
|
"mikrotik_exporter: whether a device collector succeeded",
|
||||||
[]string{"device"},
|
[]string{"device"},
|
||||||
nil,
|
nil,
|
||||||
)
|
)
|
||||||
@ -275,7 +275,7 @@ func (c *collector) Collect(ch chan<- prometheus.Metric) {
|
|||||||
d.Address = strings.TrimRight(s.Target, ".")
|
d.Address = strings.TrimRight(s.Target, ".")
|
||||||
d.User = dev.User
|
d.User = dev.User
|
||||||
d.Password = dev.Password
|
d.Password = dev.Password
|
||||||
c.getIdentity(&d)
|
_ := c.getIdentity(&d)
|
||||||
realDevices = append(realDevices, d)
|
realDevices = append(realDevices, d)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -302,7 +302,7 @@ func (c *collector) getIdentity(d *config.Device) error {
|
|||||||
log.WithFields(log.Fields{
|
log.WithFields(log.Fields{
|
||||||
"device": d.Name,
|
"device": d.Name,
|
||||||
"error": err,
|
"error": err,
|
||||||
}).Error("error dialing device")
|
}).Error("error dialing device fetching identity")
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer cl.Close()
|
defer cl.Close()
|
||||||
|
Loading…
Reference in New Issue
Block a user