Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Net-snmp cannot execute shell script!
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
qhfeiniao
n00b
n00b


Joined: 23 Jan 2008
Posts: 2

PostPosted: Wed Jan 23, 2008 4:50 pm    Post subject: [SOLVED] Net-snmp cannot execute shell script! Reply with quote

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
View user's profile Send private message
qhfeiniao
n00b
n00b


Joined: 23 Jan 2008
Posts: 2

PostPosted: Fri Jan 25, 2008 5:25 pm    Post subject: Reply with quote

I ues 'extend' insted of 'exec', then it worked normally. But i still didn't know why?
Back to top
View user's profile Send private message
c23
n00b
n00b


Joined: 06 Dec 2012
Posts: 1

PostPosted: Thu Dec 06, 2012 3:07 pm    Post subject: Took me a long time but it is written in the man page Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum