# # On a openwrt box defaults to "nvram get lan_ifname" otherwise
# # no default.
#
# Written by Nicolai Langfeldt (janl@linpro.no) 2007/02/18
#
# Bugs:
# - Should have a persistent list of macs ever seen
#
# License: GPL v.2
#
#%# family=contrib
#%# capabilities=autoconf
#
PATH=/usr/bin:/usr/sbin:/bin:/sbin
export PATH
AL="$(wl assoclist 2>&1)"
WLERR=$?
case $WLERR in
0) MACS="$(echo "$AL" | cut -d' ' -f2)";;
esac
do_ () {
# Fetch
for M in $MACS; do
RSSI=$(wl rssi $M | cut -d' ' -f3)
m=$(echo $M | tr -d ':')
echo rssi$m.value $RSSI
done
}
do_config () {
cat <<'EOF'
graph_title WiFi AP RSSI
graph_vlabel dB(?)
graph_category network
graph_info This plugin shows the RSSI (Received Signal Strength Indication) as reported by the Access Point (AP) driver. The plugin is specific to broadcom wireless chipsets such as used on WRT hardware. We're not <em>quite</em> sure about the units the RSSI is measured in as this is not documented. Both dB and dBm are apparently candidates. Higher is better.
EOF
# Atempt to find default. "Set default" and "assign default" syntax is
# not available in busybox (which is used in openwrt firmware) it seems.
# So work around it with case.
: ${WIFISIDE:=$(nvram get lan_ifname 2>/dev/null)}