Merge pull request #425 from mdlayher/wifi-update

Update vendored wifi, handle stations with missing info
This commit is contained in:
Ben Kochie 2017-01-20 08:43:44 -05:00 committed by GitHub
commit acb495ccab
6 changed files with 288 additions and 41 deletions

View file

@ -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)
}