Exec command in SNMPD
Topic: Exec command in SNMPD
(Read 2015 times)
Exec command in SNMPD
Oct 16, 2017, 08:08 pm
: Oct 16, 2017, 08:17 pm by davidrs16
First of all I would like to give you thanks in advance to this communitty becouse is very usefull in order to give support for our project.
I´m posting this because I have purchased and arduino Yun weeks ago, and I would like to use SNMP in order to monitor serveral variables(the most part of them are sensors) from the sketch. Using the bridge i can get that info from the sketch in the linux side but my issue is to put this in to the SNMP OIDs, I have seen another guys that use some defined OIDs in the standard tree to put the values, exactly these:
iso.18.104.22.168.22.214.171.124.1.18.1 = ""
iso.126.96.36.199.188.8.131.52.1.18.2 = ""
iso.184.108.40.206.220.127.116.11.1.18.3 = ""
iso.18.104.22.168.22.214.171.124.1.18.5 = ""
My problem is that I need to pass more than 30 variables, so I think that the best way for this is to use SNMP exec feature to exectute custom scripts and place the results in customs OIDs, I have tried to setup this several times, with out success, these are my SNMPD configuration files:
This is /etc/config/snmpd(only the part that I have added from the stock file)
option name test1
option prog /bin/echo
option args Hello
option miboid 126.96.36.199
When the services start the init script generate this snmpd config file:
com2sec ro default public
com2sec rw localhost private
group public v1 ro
group public v2c ro
group public usm ro
group private v1 rw
group private v2c rw
group private usm rw
view all included .1
access public "" any noauth exact all none none
access private "" any noauth exact all all all
exec filedescriptors /bin/cat /proc/sys/fs/file-nr
exec 188.8.131.52 test1 /bin/echo Hello
It looks to be fine as you can see the las line looks to have the correct format(is a basic example), but when I perform and Snmpwalk I cannot see the part of the tree of the exec with a custom OID with value
I have performed a lot test without succes. I need help at this point, I´m stuck. I was able to make this working in ubuntu distro using extend instead of exec.
The yun linilo is uptoday, i don´t know if I am doing something wrong or if this is a bug of the openwrt snmp daemon.
Thanks in advance