Aug 2, 2010 11:49 AM
check_snmp not working with quotes
-
Like (0)
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
$ /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
I forgot to add, no combination of quoting or escaping that I have tried on the OID string has produced success.
Perhaps try a numeric response? I know Zenoss itself only likes numbers in SNMP responses.
--
James Pulver
Information Technology Area Supervisor
LEPP Computer Group
Cornell University
Follow Us On Twitter »
|
Latest from the Zenoss Blog » | Community | Products | Services Resources | Customers Partners | About Us | ||
Copyright © 2005-2011 Zenoss, Inc.
|
||||||||