apcupsd unable to do killpower with snmp driver

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

apcupsd unable to do killpower with snmp driver

Павел Мотырев

As the post subject suggests, I am unable to shutdown my UPS with SNMP module.

Issue was observed on:

  OS: Ubuntu 16.10
  Apcupsd version: 3.14.14 (31 May 2016)
  UPS: Smart-UPS 2200
  SNMP module:
    MN:AP9619 HR:A10 MD:11/02/2005
    AOS: 3.7.3 (02/02/2010), StatApp(name: sumx): 3.7.2 (02/02/2010)

tcpdump after "apcupsd --killpower" exec:
<...lines with getting UPS state...>
IP > C=xxx SetRequest(33) .
IP > C=xxx GetResponse(33) noSuchName@1 .

Main cause - OID for upsBasicControlConserveBattery is incorrect.
Correct upsBasicControlConserveBattery OID is . (additional ".0" at the end)

I have tested this OID manually with snmpset - it's working correct.
Here tcpdump of this tests with comments:
IP > C=xxx SetRequest(35) .
IP > C=xxx GetResponse(35) genErr@1 . // it's ok. UPS not on battery power.
IP > Trap(108) . enterpriseSpecific s=5 26777240 ."UPS: On battery power in response to an input power problem."
IP > C=xxx SetRequest(35) .
IP > C=xxx GetResponse(35) . // UPS correctly going to sleep

Same problem with upsAdvControlUpsOff - correct OID is . (additional ".0" at the end).

In attach - patch with trying to fixing this problem in simplest way and output of snmp-walk from my UPS SNMP module.

Also, from power.mib you can see that some other OIDs must be changed by adding ".0" at the end. I've fixed only 2 values, because any other OIDs are not used to write.

Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Apcupsd-users mailing list
[hidden email]

power.mib (48K) Download Attachment
fix-snmp-oids.patch (1K) Download Attachment