Archived community.zenoss.org | full text search
Skip navigation
8863 Views 2 Replies Latest reply: Aug 2, 2010 12:17 PM by jmp242 RSS
nick.anderson Rank: White Belt 18 posts since
Mar 2, 2010
Currently Being Moderated

Aug 2, 2010 11:49 AM

check_snmp not working with quotes

I am trying to use check_snmp to get the value of a custom script using extend in snmpd.

 

 

$ ./check_snmp -P 2c -H 192.168.5.1 -C public -o NET-SNMP-EXTEND-MIB::nsExtendResult."echotest"
SNMP problem - No data received from host
CMD: /usr/local/zenoss/common/bin/snmpget -t 1 -r 5 -m ALL -v 2c [authpriv] 192.168.5.1:161  NET-SNMP-EXTEND-MIB::nsExtendResult.echotest

 

snmpget does work directly when correctly quoted
$ /usr/local/zenoss/common/bin/snmpget -t 1 -r 5 -m ALL -v 2c -c public 192.168.5.1:161  'NET-SNMP-EXTEND-MIB::nsExtendResult."echotest"'
NET-SNMP-EXTEND-MIB::nsExtendResult."echotest" = INTEGER: 0


 

The line I have in my snmpd.conf is

extend echotest /bin/echo hi

 

It works, as I can see it with snmpwalk.


$ snmpwalk -v 2c -c public localhost .1 | grep echotest

NET-SNMP-EXTEND-MIB::nsExtendCommand."echotest" = STRING: /bin/echo
NET-SNMP-EXTEND-MIB::nsExtendArgs."echotest" = STRING: hi
NET-SNMP-EXTEND-MIB::nsExtendInput."echotest" = STRING: 
NET-SNMP-EXTEND-MIB::nsExtendCacheTime."echotest" = INTEGER: 5
NET-SNMP-EXTEND-MIB::nsExtendExecType."echotest" = INTEGER: exec(1)
NET-SNMP-EXTEND-MIB::nsExtendRunType."echotest" = INTEGER: run-on-read(1)
NET-SNMP-EXTEND-MIB::nsExtendStorage."echotest" = INTEGER: permanent(4)
NET-SNMP-EXTEND-MIB::nsExtendStatus."echotest" = INTEGER: active(1)
NET-SNMP-EXTEND-MIB::nsExtendOutput1Line."echotest" = STRING: hi
NET-SNMP-EXTEND-MIB::nsExtendOutputFull."echotest" = STRING: hi
NET-SNMP-EXTEND-MIB::nsExtendOutNumLines."echotest" = INTEGER: 1
NET-SNMP-EXTEND-MIB::nsExtendResult."echotest" = INTEGER: 0
NET-SNMP-EXTEND-MIB::nsExtendOutLine."echotest".1 = STRING: hi

More Like This

  • Retrieving data ...

Legend

  • Correct Answers - 4 points
  • Helpful Answers - 2 points