Cacti/OpenWRT
From fakedWiki
/etc/config/snmpd
config exec option name iwinfo option prog /usr/local/bin/iwinfo.sh option args wlan0 config exec option name iwinfo option prog /usr/local/bin/iwinfo.sh option args wlan1
/usr/local/bin/iwinfo.sh
#!/bin/bash if [ ${#} -ne 1 ]; then echo "Usage: $0 <interface>" exit 0 fi INFO=`iwinfo ${1} info` CHANNEL=`echo "${INFO}" | sed -n 's/.*Channel:\ \(.*\)\ (.*)/\1/p'` TXPOWER=`echo "${INFO}" | sed -n 's/.*Tx-Power:\ \(.*\)\ dBm.*/\1/p'` SIGNAL=`echo "${INFO}" | sed -n 's/.*Signal:\ -\(.*\)\ dBm\ \ Noise.*/\1/p'` NOISE=`echo "${INFO}" | sed -n 's/.*Noise:\ -\(.*\)\ dBm.*/\1/p'` BITRATE=`echo "${INFO}" | sed -n 's/.*Bit\ Rate:\ \(.*\)\ MBit.*/\1/p'` echo "channel:${CHANNEL} txpower:${TXPOWER} signal:${SIGNAL} noise:${NOISE} bitrate:${BITRATE}" #echo ${CHANNEL} #echo ${TXPOWER} #echo ${SIGNAL} #echo ${NOISE} #echo ${BITRATE} exit 0
/usr/share/cacti/resource/snmp_queries/iwinfo.xml
<interface> <name>Get iwinfo information</name> <description>Get statistics of the radio interface</description> <index_order_type>numeric</index_order_type> <oid_index>.1.3.6.1.4.1.2021.8.1.1</oid_index> <fields> <extIndex> <name>Index</name> <method>walk</method> <source>value</source> <direction>input</direction> <oid>.1.3.6.1.4.1.2021.8.1.1</oid> </extIndex> <extNames> <name>Device</name> <method>walk</method> <source>value</source> <direction>input</direction> <oid>.1.3.6.1.4.1.2021.8.1.2</oid> </extNames> <extOutput> <name>Value</name> <method>walk</method> <source>value</source> <direction>output</direction> <oid>.1.3.6.1.4.1.2021.8.1.101</oid> </extOutput> </fields> </interface>