View previous topic :: View next topic |
Author |
Message |
qhfeiniao n00b
Joined: 23 Jan 2008 Posts: 2
|
Posted: Wed Jan 23, 2008 4:50 pm Post subject: [SOLVED] Net-snmp cannot execute shell script! |
|
|
my net-snmp cannot execute a shell script
here is my snmpd.conf
Code: |
com2sec local 127.0.0.1 public
group MyROGroup v1 local
group MyROGroup v2c local
group MyROGroup usm local
view all included .1 80
access MyROGroup "" any noauth exact all none none
exec .1.3.6.1.4.1.2021.51 linknumber /bin/sh /etc/snmp/script/link.sh
#syslocation MyLocation
#syscontact Me <me@somewhere.org>
|
when i try this:
Code: | snmpwalk -v 2c -c public 127.0.0.1 .1.3.6.1.4.1.2021.51 |
it told me:
Code: | UCD-SNMP-MIB::ucdavis.51 = No Such Object available on this agent at this OID |
anyone who can help me ?
Last edited by qhfeiniao on Fri Jan 25, 2008 5:27 pm; edited 2 times in total |
|
Back to top |
|
|
qhfeiniao n00b
Joined: 23 Jan 2008 Posts: 2
|
Posted: Fri Jan 25, 2008 5:25 pm Post subject: |
|
|
I ues 'extend' insted of 'exec', then it worked normally. But i still didn't know why? |
|
Back to top |
|
|
c23 n00b
Joined: 06 Dec 2012 Posts: 1
|
Posted: Thu Dec 06, 2012 3:07 pm Post subject: Took me a long time but it is written in the man page |
|
|
I hit exactly the same issue.
If you look at man page of snmpd.conf :
extend [MIBOID] NAME PROG ARGS
works in a similar manner to the exec directive, but with a number of improvements. The MIB
tables (nsExtendConfigTable etc) are indexed by the NAME token, so are unaffected by the order
in which entries are read from the configuration files.
I suppose you rooted (just like I did) your custom OID under an existing MIBOID (the default ones used by the system), so your "exec" entry was ignored. I suppose the order is to read the main MIBs, then process the custom "exec" directives (means, your "exec" directive was read "at the end")
Using "extend" will force the custom OID you used to be mounted under an existing MIDOIB, no matter the "order" OIDs were defined. |
|
Back to top |
|
|
|