Update vendored wifi, handle stations with missing info

This commit is contained in:
Matt Layher 2017-01-17 00:54:18 -05:00
commit ca3f07feef
No known key found for this signature in database
GPG key ID: 77BFE531397EDE94
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)
}