Go Down

Topic: Exec command in SNMPD (Read 4632 times) previous topic - next topic


Oct 16, 2017, 08:08 pm Last Edit: Oct 16, 2017, 08:17 pm by davidrs16
Hi all,

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. = ""
iso. = ""
iso. = ""
iso. = ""

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)
  config exec
        option name     test1
        option prog     /bin/echo
        option args     Hello
        option miboid

When the services start the init script generate this snmpd config file:

     agentaddress UDP:161
     sysLocation office
     sysContact bofh@example.com
     sysName HeartOfGold
     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 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 Hello

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

Go Up