How to output the radio status of a DD-WRT box over SNMP
By: Cas Mollien Last modified on: 10 November 2008, 17:43h
My Linksys WRT54G with the brilliant DD-WRT firmware has one of those 'EasyConnect' buttons, that can be remapped to turn the radio on or off. I want to have my Nagios box check if my DD-WRT based router has it's radio turned on or not.
Since my Nagios box monitors almost everything over SNMP and since this router fully supports it, I figured that it would be best to just use this technology instead of re-inventing the wheel.
I came up with the following solution, which should work, but somehow I cannot write anything to JFFS2, so this is untested for now (consider this a 'note-to-self'):
1) Through the web interface (Administration -> Commands), add the following lines and click on 'Save Startup':
This will add an extra command to the SNMP daemon and restart it, after which it will automatically run the radio check command and pass the output to the custom SNMP MIB.
2) Now, test the functionality, Just SNMP-walk the following MIB: .220.127.116.11.4.1.2021.8.1
The output value you are looking for should be stored in: .18.104.22.168.4.1.2021.8.1.101
SNMPGET the last MIB and you should get a result like '0x0000' or '0x0001'. 0x0000 means 'ON', 0x0001 means 'OFF'.
3) If you are using Nagios, you can use this quick-and-dirty Nagios plugin that parses this output and translates it to Nagios output (performance data is most likely not according to spec, though, if you need to use this).