snmpapccacti

Snmpget returns noSuchName but snmpwalk works, not a instance number issue


I recently hooked up an APC battery backup to one of my servers, I installed the powerchute agent on the server and have verified that I can remotely access the agent and the APC through the agent.

I am trying to get my Cacti install to retrieve my APC data, and everything is working except that it is returning "Result from SNMP not valid. Partial Result: U" and I suspect it is do to the SNMP problem I am having. How can I fix it so the MIB works with the instance number?

From the command line I can successfully GET other OIDs.

----WORKS----
$ snmpget -v1 -cpublic 192.168.1.2 .1.3.6.1.2.1.1.3.0
iso.3.6.1.2.1.1.3.0 = Timeticks: (140629508) 16 days, 6:38:15.08

From the command line I can snmpwalk the powerchute MIB as long as I do not add the final instance number. Adding the instance number causes nothing to be returned.

----WORKS----
$ snmpwalk -v1 -cpublic 192.168.1.2 .1.3.6.1.4.1.318.1.1.1.2.2.3
iso.3.6.1.4.1.318.1.1.1.2.2.3.0 = Timeticks: (72000) 0:12:00.00

----FAILS----
$ snmpwalk -v1 -cpublic 192.168.1.2 .1.3.6.1.4.1.318.1.1.1.2.2.3.0
$

However I can not snmpget any of the powerchute OIDs with or without the instance number.

----FAILS----
$ snmpget -v1 -cpublic 192.168.1.2 .1.3.6.1.4.1.318.1.1.1.2.2.3.0
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: iso.3.6.1.4.1.318.1.1.1.2.2.3.0

----FAILS----
$ snmpget -v1 -cpublic 192.168.1.2 .1.3.6.1.4.1.318.1.1.1.2.2.3
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: iso.3.6.1.4.1.318.1.1.1.2.2.3

Solution

  • The fact that snmpwalk returns an OID that you consequently cannot snmpget indicates a bug in the SNMP agent of the device you are accessing.

    As frustrating as this is it isn't uncommon, even in enterprise equipment. I've encountered SNMP agent bugs in Cisco and Nortel telecommunications equipment costing hundreds of thousands of dollars.

    You do have a work-around. Consider writing a BASH script to snmpwalk the desired value and scrape the result. And tell Cacti to use your custom script instead of accessing via SNMP directly.