Skip to content

Commit

Permalink
Merge pull request #425 from mdlayher/wifi-update
Browse files Browse the repository at this point in the history
Update vendored wifi, handle stations with missing info
  • Loading branch information
SuperQ authored Jan 20, 2017
2 parents 2a0c80c + ca3f07f commit acb495c
Show file tree
Hide file tree
Showing 6 changed files with 288 additions and 41 deletions.
16 changes: 10 additions & 6 deletions collector/wifi_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,19 +155,23 @@ 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,
mHzToHz(ifi.Frequency),
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)
}

Expand Down
13 changes: 13 additions & 0 deletions vendor/github.com/mdlayher/wifi/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

158 changes: 145 additions & 13 deletions vendor/github.com/mdlayher/wifi/client_linux.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 5 additions & 12 deletions vendor/github.com/mdlayher/wifi/client_others.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit acb495c

Please sign in to comment.