1

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
Jereme
  • 630
  • 6
  • 18
  • `snmpwalk` may be implemented in terms of `getnext`s. And a `getnext` does not `get` the value provided, it gets the *next* value. So it makes sense that `snmpwalk` _instance_ will not fetch _instance_ itself. – PP. Sep 05 '13 at 13:34

1 Answers1

1

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.

PP.
  • 10,764
  • 7
  • 45
  • 59
  • I had thought of that option, but was hoping to avoid it considering many other cacti users claim to have implemented this successfully. Does anyone have such a script made up already? I will search the cacti forums, then buckle down and write one if I fail to find anything. – Jereme Sep 05 '13 at 16:02
  • 1
    I just went to write my own shell script, and I discovered that after letting the servers sit for a couple of weeks the SNMP get is working correctly now. They have gone through a reboot in that time which might have been the trigger that started them all working. – Jereme Sep 26 '13 at 22:04