OpenWrt Forum Archive

Topic: SNMP question: possible to integrate wifi-data?

The content of this topic has been archived on 31 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

hello all!

i'm quite new to snmp, but i want to use it to monitor much wrts, it already works fine for eg. traffic data.
the concrete question now is whether i can use snmp to retrieve stuff like the rssi-value.
does anybody have a solution to this?

thanks,
der_flo

*bump*
sorry, it's quite important.

Use the exec module from SNMP coupled with informations coming from wl rssi.

Is there an SNMP package out there that has exec mode compiled in? The package I built doesn't have it.

If you have control of the WRT, you can do anything that storage will allow.  You could write
an SNMP sub-agent to extend the current OIDs.  Just remember that what data you need to retrieve
should be available within 6 seconds.
Some of the SNMP data comes from the /proc file system amoung other places.  I have writen
sub-agents that use a script to get and transmit the data back to the caller.  Of course that was with
apache.  I have not looked at the OpenWRT SNMP packages, so I don't know if you can do that
with them.  But you have the source and can do anything you want to do.

You are talking about using the EXEC/passthru OIDs right? In order to be able to do that you have to have a version of snmp that is compiled with EXEC working. On the net-snmp packages that I built I could never get EXEC working. I see there are now other net-snmp packages out there, do they have exec working?

Hello,

@void Main:
does you mean the possibility to insert some own snmp definitions in the snmpd.conf?
this works fine with the snmp package from the openwrt package tracker

here my configuration:
root@OpenWrt:/etc/snmp# ls
snmp.wlnoise  snmp.wlrate   snmp.wlrssi   snmpd.conf

root@OpenWrt:/etc/snmp# vi snmpd.conf
syslocation Unknown
syscontact root
sysname wrt54g
.
.
.
exec wlrate /etc/snmp/snmp.wlrate
exec wlrssi /etc/snmp/snmp.wlrssi
exec wlnoise /etc/snmp/snmp.wlnoise
....

root@OpenWrt:/etc/snmp# vi snmp.wlrate
#!/bin/sh
/usr/sbin/wl rate | sed -e 's/rate is \(.*\) Mbps/\1/'


here the output of my mib-browser:  (noise is 0 because AP-mode)
.1.3.6.1.4.1.2021.4.101.0    Running out of swap space (0)
.1.3.6.1.4.1.2021.8.1.1.1    1
.1.3.6.1.4.1.2021.8.1.1.2    2
.1.3.6.1.4.1.2021.8.1.1.3    3
.1.3.6.1.4.1.2021.8.1.2.1    wlrate
.1.3.6.1.4.1.2021.8.1.2.2    wlrssi
.1.3.6.1.4.1.2021.8.1.2.3    wlnoise
.1.3.6.1.4.1.2021.8.1.3.1    /etc/snmp/snmp.wlrate
.1.3.6.1.4.1.2021.8.1.3.2    /etc/snmp/snmp.wlrssi
.1.3.6.1.4.1.2021.8.1.3.3    /etc/snmp/snmp.wlnoise
.1.3.6.1.4.1.2021.8.1.100.1    0
.1.3.6.1.4.1.2021.8.1.100.2    0
.1.3.6.1.4.1.2021.8.1.100.3    0
.1.3.6.1.4.1.2021.8.1.101.1    54
.1.3.6.1.4.1.2021.8.1.101.2    24 38
.1.3.6.1.4.1.2021.8.1.101.3    0 (off)
.1.3.6.1.4.1.2021.8.1.102.1    0
.1.3.6.1.4.1.2021.8.1.102.2    0

thanks for your answers!

@tim: is your snmp-package the one from the official buildroot? (http://downloads.openwrt.org/whiterussian/packages/)
if yes, your solution would work great your me!
i think, your post helps me very much, i'll try that as soon as possible.

ciao,
der_flo

Hallo,

@der flo
yes this solution works with the standard snmp package from openwrt-download site.
i test it with snmpd_5.1.2-1_mipsel.ipk

Tim wrote:

Hello,

@void Main:
does you mean the possibility to insert some own snmp definitions in the snmpd.conf?
this works fine with the snmp package from the openwrt package tracker

Ahhh, looks like I need to ditch the snmp package I built and get with the program. Thanks! smile

The stock snmpd package included in White Russian RC3 also works.

It was compiled with the "exec" command that was used in /etc/snmpd.conf

oh yes, it works great!
snmpwalk shows it, i will draw the data as graphs with cacti.

additional question: does anybody know a quite good snmp-tutorial? it seems, that it offers quite nice things, i want to learn it.

thank!
der_flo

The discussion might have continued from here.