Skip to content

bouk/wifireceiver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WiFi Receiver

An OpenTelemetry Collector receiver that collects WiFi interface metrics using the netlink API on Linux systems.

Description

This receiver collects WiFi statistics from wireless network interfaces, including:

  • Interface metrics: Operating frequency
  • BSS (Basic Service Set) information: SSID, BSSID, connection mode
  • Station statistics: Signal strength, bitrates, packet/byte counts, connection duration, and error metrics

Configuration

The receiver supports the following configuration:

receivers:
  wifi:
    collection_interval: 1m  # How often to scrape WiFi metrics (default: 1m)

Metrics

The receiver emits the following metrics:

Gauges

  • wifi.interface.frequency (MHz): The current frequency a WiFi interface is operating at, in megahertz
  • wifi.station.info (1): Labeled WiFi interface station information (with attributes: device, bssid, ssid, mode)
  • wifi.station.inactive (s): Seconds since any wireless activity has occurred
  • wifi.station.receive.bitrate (bps): Current WiFi receive bitrate
  • wifi.station.transmit.bitrate (bps): Current WiFi transmit bitrate
  • wifi.station.signal (dBm): Current WiFi signal strength

Sums (Monotonic Counters)

  • wifi.station.connected.total (s): Total seconds a station has been connected
  • wifi.station.receive.bytes (By): Total bytes received
  • wifi.station.transmit.bytes (By): Total bytes transmitted
  • wifi.station.transmit.retries (1): Total packet transmission retries
  • wifi.station.transmit.failed (1): Total failed packet transmissions
  • wifi.station.beacon.loss (1): Total beacon losses detected
  • wifi.station.transmitted.packets (1): Total packets transmitted
  • wifi.station.received.packets (1): Total packets received

Survey Gauges

  • wifi.survey.noise (dBm): The noise level in decibel-milliwatts
  • wifi.survey.in_use (1): Indicates if the channel is currently in use (1 for in use, 0 for not in use)

Survey Sums (Monotonic Counters)

  • wifi.survey.channel.time (s): Total time the radio spent on the channel
  • wifi.survey.channel.time.active (s): Total time the radio spent on the channel while it was active
  • wifi.survey.channel.time.busy (s): Total time the radio spent on the channel while it was busy
  • wifi.survey.channel.time.ext_busy (s): Total time the radio spent on the channel while it was busy with external traffic
  • wifi.survey.channel.time.bss_rx (s): Total time the radio spent on the channel receiving data from a BSS
  • wifi.survey.channel.time.rx (s): Total time the radio spent on the channel receiving data
  • wifi.survey.channel.time.tx (s): Total time the radio spent on the channel transmitting data
  • wifi.survey.channel.time.scan (s): Total time the radio spent on the channel while it was scanning

Attributes

Interface Metrics

  • device: The network interface name (e.g., wlan0)

Station Metrics

  • device: The network interface name (e.g., wlan0)
  • mac_address: The MAC address of the station

BSS Info Metrics

  • device: The network interface name (e.g., wlan0)
  • bssid: The BSSID of the access point
  • ssid: The SSID of the network
  • mode: Connection mode - client, ad-hoc, or unknown

Survey Metrics

  • device: The network interface name (e.g., wlan0)
  • frequency_mhz: The frequency in megahertz

Requirements

  • Linux operating system
  • Access to netlink (usually requires running as root or with CAP_NET_ADMIN capability)
  • WiFi network interface

Permissions

This receiver requires elevated permissions to access the netlink API. The collector process needs to either:

  • Run as root, or
  • Have the CAP_NET_ADMIN capability

Example Configuration

receivers:
  wifi:
    collection_interval: 30s

exporters:
  otlp:
    endpoint: localhost:4317

service:
  pipelines:
    metrics:
      receivers: [wifi]
      exporters: [otlp]

Implementation Notes

This receiver is inspired by the Prometheus node_exporter WiFi collector and uses the mdlayher/wifi package to interact with the Linux netlink API.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages