Update vendored wifi, handle stations with missing info
This commit is contained in:
parent
92537020a3
commit
ca3f07feef
6 changed files with 288 additions and 41 deletions
|
|
@ -155,12 +155,6 @@ func (c *wifiCollector) Update(ch chan<- prometheus.Metric) error {
|
|||
continue
|
||||
}
|
||||
|
||||
info, err := stat.StationInfo(ifi)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to retrieve station info for device %s: %v",
|
||||
ifi.Name, err)
|
||||
}
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.InterfaceFrequencyHertz,
|
||||
prometheus.GaugeValue,
|
||||
|
|
@ -168,6 +162,16 @@ func (c *wifiCollector) Update(ch chan<- prometheus.Metric) error {
|
|||
ifi.Name,
|
||||
)
|
||||
|
||||
info, err := stat.StationInfo(ifi)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
continue
|
||||
}
|
||||
|
||||
return fmt.Errorf("failed to retrieve station info for device %s: %v",
|
||||
ifi.Name, err)
|
||||
}
|
||||
|
||||
c.updateStationStats(ch, ifi.Name, info)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue