|
|
|
|
@ -34,6 +34,8 @@ type wifiCollector struct { |
|
|
|
|
stationInactiveSeconds *prometheus.Desc |
|
|
|
|
stationReceiveBitsPerSecond *prometheus.Desc |
|
|
|
|
stationTransmitBitsPerSecond *prometheus.Desc |
|
|
|
|
stationReceiveBytesTotal *prometheus.Desc |
|
|
|
|
stationTransmitBytesTotal *prometheus.Desc |
|
|
|
|
stationSignalDBM *prometheus.Desc |
|
|
|
|
stationTransmitRetriesTotal *prometheus.Desc |
|
|
|
|
stationTransmitFailedTotal *prometheus.Desc |
|
|
|
|
@ -111,6 +113,20 @@ func NewWifiCollector() (Collector, error) { |
|
|
|
|
nil, |
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
stationReceiveBytesTotal: prometheus.NewDesc( |
|
|
|
|
prometheus.BuildFQName(namespace, subsystem, "station_receive_bytes_total"), |
|
|
|
|
"The total number of bytes received by a WiFi station.", |
|
|
|
|
labels, |
|
|
|
|
nil, |
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
stationTransmitBytesTotal: prometheus.NewDesc( |
|
|
|
|
prometheus.BuildFQName(namespace, subsystem, "station_transmit_bytes_total"), |
|
|
|
|
"The total number of bytes transmitted by a WiFi station.", |
|
|
|
|
labels, |
|
|
|
|
nil, |
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
stationSignalDBM: prometheus.NewDesc( |
|
|
|
|
prometheus.BuildFQName(namespace, subsystem, "station_signal_dbm"), |
|
|
|
|
"The current WiFi signal strength, in decibel-milliwatts (dBm).", |
|
|
|
|
@ -256,6 +272,22 @@ func (c *wifiCollector) updateStationStats(ch chan<- prometheus.Metric, device s |
|
|
|
|
info.HardwareAddr.String(), |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
ch <- prometheus.MustNewConstMetric( |
|
|
|
|
c.stationReceiveBytesTotal, |
|
|
|
|
prometheus.CounterValue, |
|
|
|
|
float64(info.ReceivedBytes), |
|
|
|
|
device, |
|
|
|
|
info.HardwareAddr.String(), |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
ch <- prometheus.MustNewConstMetric( |
|
|
|
|
c.stationTransmitBytesTotal, |
|
|
|
|
prometheus.CounterValue, |
|
|
|
|
float64(info.TransmittedBytes), |
|
|
|
|
device, |
|
|
|
|
info.HardwareAddr.String(), |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
ch <- prometheus.MustNewConstMetric( |
|
|
|
|
c.stationSignalDBM, |
|
|
|
|
prometheus.GaugeValue, |
|
|
|
|
|