Closed bnerickson closed 1 year ago
I'm also open to changing the name of the script/application to something less generic than "Wireless AP". On Linux, wireless AP functionality is typically provided via the hostapd service. However, naming this script after hostapd seems wrong since hostapd is never queried directly by this script.
I'm also open to changing the name of the script/application to something less generic than "Wireless AP". On Linux, wireless AP functionality is typically provided via the hostapd service. However, naming this script after hostapd seems wrong since hostapd is never queried directly by this script.
Personally I would go with linux_iw or something like that. All good though. :)
In regards to client_lifetime, this is something I would personally move into the LibreNMS config as well as adding a optional setting of allowing it accept settings for that from the remote system.
The name change makes sense. I tested the script out on a wireless client and it does pull some stats for its connection to an AP, so I changed the name of the script to "linux_iw" and made a change to grab the type or mode the interface is operating under ("AP" for instance). The linux_iw application is being updated in https://github.com/librenms/librenms/pull/14677 such that the graphs will display whether the data corresponds to a client (when the polled device is an AP) or an AP (when the polled device is a wireless client).
I also updated the script to return "null" if no "client_lifetime" (now referred to as "linux_iw_cap_lifetime") is specified in the linux_iw.json config file, so a global default can be specified by the user in the LibreNMS config. The value specified in linux_iw.json will override the global default.
Awesome! :)
This script is intended for usage on a Linux wireless AP to grab wireless statistics from all attached interfaces and all stations that are connected to said interfaces. All of the interfaces and stations are automatically discovered. This script should work independent of whether the server is OpenWRT, Fedora-based, Debian-based, etc.
Wireless statistics are grabbed using the following iw commands:
There are a couple of optional features that can be specified in the /etc/snmp/wireless.json configuration file:
Example json output:
Here are a couple screenshots of what this will look like in LibreNMS once all is said and done:
Improvements: I could see someone coming in and adding filter lists to exclude statistics for particular interfaces or stations from being collected for privacy or other reasons. In my use-case, I don't have those concerns.