mad_ady
Regular Contributor
Hello everyone!
I'd like to keep an eye on who is connected over OpenVPN, so I thought I'd make a script to parse openvpn status and report back who is connected via snmp (there is a snmp agent polling the router periodically). To do this I enabled snmp and it works (I am able to get data for IF-MIB), but I'd like to extend it with custom scripts.
As far as I've seen I could use the 'extend' keyword, add a string and the path to the script in the configuration and the script's output should be exposed via SNMP in the NET-SNMP-EXTEND-MIB (http://www.oidview.com/mibs/8072/NET-SNMP-EXTEND-MIB.html). I've added the following line to /tmp/snmpd.conf and restarted snmpd manually:
However, when I do a snmpwalk, I do not get that OID. It could be that the OID is out of tree, so a direct walk would not expose it, so I tried specific walks, like this:
So, it seems that extended objects are not supported?
Any ideas what I should try next? I'm thinking of the following:
1. Disable builtin SNMP and install snmpd from opkg in hopes that it's more complete
2. Research a different way to expose a script's output via SNMP
Has anyone played with this before?
I'd like to keep an eye on who is connected over OpenVPN, so I thought I'd make a script to parse openvpn status and report back who is connected via snmp (there is a snmp agent polling the router periodically). To do this I enabled snmp and it works (I am able to get data for IF-MIB), but I'd like to extend it with custom scripts.
As far as I've seen I could use the 'extend' keyword, add a string and the path to the script in the configuration and the script's output should be exposed via SNMP in the NET-SNMP-EXTEND-MIB (http://www.oidview.com/mibs/8072/NET-SNMP-EXTEND-MIB.html). I've added the following line to /tmp/snmpd.conf and restarted snmpd manually:
Code:
extend test /bin/echo hello
Code:
$ snmpwalk -v2c -c public 192.168.1.1 1.3.6.1.4.1.8072.1.3.2
iso.3.6.1.4.1.8072.1.3.2 = No Such Object available on this agent at this OID
Any ideas what I should try next? I'm thinking of the following:
1. Disable builtin SNMP and install snmpd from opkg in hopes that it's more complete
2. Research a different way to expose a script's output via SNMP
Has anyone played with this before?