Loading ...
Home » Spaces » Racks, Rack Accessories, & Cooling » discussion » General » AP7953 - SNMP Outlet state/change

AP7953 - SNMP Outlet state/change

Discussion in Racks, Rack Accessories, & Cooling started by Thomas , 9/13/2017 3:47 PM
Login to follow, share, and participate in this space.
Not a member?Join now
  • insertcoin
    Novice Novice
    Thomas 9/13/2017 3:47 PM

    Hi All, 

    Just inherited a 7953 and trying to get it configured. The biggest hurdle is that the web interface doesn't support TLS1.2 or SSL3 so thats not accessible in Chrome, etc.

    I thought it would therefore be easier to use SNMP and a php script as the only control I need is to turn on/off sockets. 

    Got the PDU setup and I can access SNMP but I am not seeing anything related to the outlet state, which from the MIB should be PowerNet-MIB::rPDUOutletStatusOutletState.

    Is there something I need to do to allow this, or that needs to be activated?

    Hardware Factory
    Model Number: AP7954
    Serial Number: xxxxxxxxx
    Hardware Revision: B2
    Manufacture Date: 06/21/2006
    MAC Address: xxxxxxx
    Management Uptime: 0 Days 2 Hours 20 Minutes

    Application Module
    Name: rpdu
    Version: v3.9.2
    Date: 07/07/2016
    Time: 10:40:30

    APC OS (AOS)
    Name: aos
    Version: v3.9.2
    Date: 07/06/2016
    Time: 15:12:05
  • ipicKedawinna
    =S= Representative
    Angela 9/13/2017 6:39 PM (in response to Thomas)

    Hi Thomas,

    You're in the right area in our SNMP MIB. Are you able to do a walk the PDU at all?

    SNMPv1 is enabled on the PDU by default but if you inherited it, perhaps it is disabled or incorrectly configured? Check under Administration tab->Network sub tab->SNMPv1 configuration in the web. (Seems like you were maybe in the web at some point to copy/paste that firmware info though you said HTTPS wasn't working in modern browser. SNMP config can also be checked via Telnet/SSH or local serial console.) If you want to use SNMPv3, that can be turned on and you just have to configure it.

    If you verify SNMPv1 or SNMPv3 is enabled and configured with community strings and access control settings, then I'd try a walk from the top of the MIB on the PDU and see what comes back.

    The control outlet OID is here: .iso.org.dod.internet.private.enterprises.apc.products.hardware.rPDU.rPDUOutlet.rPDUOutletControl.rPDUOutletControlTable.rPDUOutletControlEntry.rPDUOutletControlOutletCommand

    Then, you just will have to specify an SNMP instance on that OID (to indicate which outlet you want to control). Here is the description on that OID:

    Getting this variable will return the outlet state. If
     the outlet is on, the immediateOn (1) value will be returned.
     If the outlet is off, the immediateOff (2) value will be
     Setting this variable to immediateOn (1) will immediately turn
     the outlet on.
     Setting this variable to immediateOff (2) will immediately turn
     the outlet off.
     Setting this variable to immediateReboot (3) will immediately
     reboot the outlet.
     Setting this variable to delayedOn (4) will turn the outlet on
     after the rPDUOutletConfigPowerOnTime OID time has elapsed.
     Setting this variable to delayedOff (5) will turn the outlet off
     after the rPDUOutletConfigPowerOffTime OID time has elapsed.
     Setting this variable to delayedReboot (6) will cause the
     Switched Rack PDU to perform a delayedOff command, wait the
     rPDUOutletConfigRebootDuration OID time, and then perform a
     delayedOn command.
     Setting this variable to cancelPendingCommand (7) will cause any
     pending command to this outlet to be canceled.

    rPDUOutletStatusOutletState is a read only OID to get the current outlet state. You'll want to use the OID I shared above to control the outlets. 

    If you have outlet groups you want to control, I think you can use that same OID somehow if you issue a command to one of the outlets in the same group (I'd have to do a walk on a device with groups to confirm that).

    In addition to SNMP, we have a special CLI available via Telnet/SSH/serial connection that may be of help for scripting outlet control. Check here for more info and how to access -> http://www.apc.com/us/en/faqs/FA156163

    Hope this helps.

  • insertcoin
    Novice Novice
    Thomas 9/14/2017 8:49 AM (in response to Angela)

    Shortly after I posted this I figured out what was going wrong. 

    I ran snmpwalk with the first OID defined to run through the whole list:

    snmpwalk -v 3 -l authNoPriv -u "wsername" -a MD5 -A "Pa55Word!" xxx.xxx.xxx.xxx .

    This then returned all the details for the device:

    SNMPv2-SMI::enterprises.318. = STRING: "B2"
    SNMPv2-SMI::enterprises.318. = STRING: "v3.9.2"
    SNMPv2-SMI::enterprises.318. = STRING: "06/21/2006"
    SNMPv2-SMI::enterprises.318. = STRING: "AP7954"
    SNMPv2-SMI::enterprises.318. = STRING: "xxxxxx"
    SNMPv2-SMI::enterprises.318. = INTEGER: 6
    SNMPv2-SMI::enterprises.318. = STRING: "On  On  On  On  On  On  On  On  On  On  On  On  On  On  On  On  On  On  On  On  On  On  On  On  "
    SNMPv2-SMI::enterprises.318. = STRING: "No  No  No  No  No  No  No  No  No  No  No  No  No  No  No  No  No  No  No  No  No  No  No  No  "
    SNMPv2-SMI::enterprises.318. = INTEGER: 0
    SNMPv2-SMI::enterprises.318. = INTEGER: 0
    SNMPv2-SMI::enterprises.318. = STRING: "pdu1.cwcs.co.uk"
    SNMPv2-SMI::enterprises.318. = INTEGER: 24
    SNMPv2-SMI::enterprises.318. = INTEGER: 1
    SNMPv2-SMI::enterprises.318. = INTEGER: 2
    SNMPv2-SMI::enterprises.318. = INTEGER: 3
    SNMPv2-SMI::enterprises.318. = INTEGER: 4
    SNMPv2-SMI::enterprises.318. = INTEGER: 5
    SNMPv2-SMI::enterprises.318. = INTEGER: 6
    SNMPv2-SMI::enterprises.318. = INTEGER: 7
    SNMPv2-SMI::enterprises.318. = INTEGER: 8
    SNMPv2-SMI::enterprises.318. = INTEGER: 9
    SNMPv2-SMI::enterprises.318. = INTEGER: 10
    SNMPv2-SMI::enterprises.318. = INTEGER: 11
    SNMPv2-SMI::enterprises.318. = INTEGER: 12
    SNMPv2-SMI::enterprises.318. = INTEGER: 13
    SNMPv2-SMI::enterprises.318. = INTEGER: 14
    SNMPv2-SMI::enterprises.318. = INTEGER: 15
    SNMPv2-SMI::enterprises.318. = INTEGER: 16
    SNMPv2-SMI::enterprises.318. = INTEGER: 17
    SNMPv2-SMI::enterprises.318. = INTEGER: 18
    SNMPv2-SMI::enterprises.318. = INTEGER: 19
    SNMPv2-SMI::enterprises.318. = INTEGER: 20
    SNMPv2-SMI::enterprises.318. = INTEGER: 21
    SNMPv2-SMI::enterprises.318. = INTEGER: 22

    I have tried to load the MIB into my test Ubuntu server, but its not having it, keeps returning "Cannot adopt OID in PowerNet-MIB: .." but continues and the OIDs are returned in the format I am familiar with:

    iso. = STRING: "The MIB Module from SNMPv2 entities"
    iso. = STRING: "SNMP Management Architecture MIB"
    iso. = STRING: "Message Processing and Dispatching MIB"
    iso. = STRING: "USM User MIB"
    iso. = STRING: "VACM MIB"
    iso. = Timeticks: (0) 0:00:00.00
    iso. = Timeticks: (0) 0:00:00.00
    iso. = Timeticks: (0) 0:00:00.00
    iso. = Timeticks: (0) 0:00:00.00
    iso. = Timeticks: (0) 0:00:00.00
    iso. = INTEGER: 2
    iso. = INTEGER: 1
    iso. = INTEGER: 2
    iso. = STRING: "LOOPBACK"
    iso. = STRING: "lance"
    iso. = INTEGER: 24
    iso. = INTEGER: 6
    iso. = INTEGER: 1500

    Which I can then work. The above is something to do with the OS and not the APC device. 

  • ipicKedawinna
    =S= Representative
    Angela 9/14/2017 2:49 PM (in response to Thomas)

    Thanks for looping back and sharing what you found.

  • insertcoin
    Novice Novice
    Thomas 9/15/2017 9:01 AM (in response to Angela)

    Thought I would share the script I wrote for the benefit of others. Find it really frustrating when people get answers online and then don't share the solution of how they did something etc. 

    The attached script snmp.php (renamed to .txt so it could be uploaded) was a very quick prototype script I wrote to test the functionality of SNMP on the 7953 PDUs. 

    It's fairly simple as the script simply does an SNMP walk to get the port settings and then provides some simple controls using SNMP set. The script is missing validation, and other things that would help. It was written quickly and so has no functions etc. but hopefully provides someone with guidance. 

    I tried the following script https://github.com/maltris/sappss/blob/master/index.php initially, but it wouldn't work for me and I didn't like the jquery $.get stuff so rewrote it, only keeping the snmp3_set and snmp3_walk commands (with a minor alteration). 

  • Page 1 of 1 (5 items)
Choose your language:  
powered by Communifire
Version 5.2.6420.11692