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 days ago
Login to follow, share, and participate in this space.
Not a member?Join now
  • insertcoin
    Thomas
    Novice Novice
    Thomas 9 days ago

    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
    Angela
    =S= Representative
    Angela 8 days ago (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
     returned.
     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
    Thomas
    Novice Novice
    Thomas 8 days ago (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 .1.3.6.1.4.1.318

    This then returned all the details for the device:

    SNMPv2-SMI::enterprises.318.1.1.4.1.1.0 = STRING: "B2"
    SNMPv2-SMI::enterprises.318.1.1.4.1.2.0 = STRING: "v3.9.2"
    SNMPv2-SMI::enterprises.318.1.1.4.1.3.0 = STRING: "06/21/2006"
    SNMPv2-SMI::enterprises.318.1.1.4.1.4.0 = STRING: "AP7954"
    SNMPv2-SMI::enterprises.318.1.1.4.1.5.0 = STRING: "xxxxxx"
    SNMPv2-SMI::enterprises.318.1.1.4.2.1.0 = INTEGER: 6
    SNMPv2-SMI::enterprises.318.1.1.4.2.2.0 = 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.1.1.4.2.3.0 = 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.1.1.4.3.1.0 = INTEGER: 0
    SNMPv2-SMI::enterprises.318.1.1.4.3.2.0 = INTEGER: 0
    SNMPv2-SMI::enterprises.318.1.1.4.3.3.0 = STRING: "pdu1.cwcs.co.uk"
    SNMPv2-SMI::enterprises.318.1.1.4.4.1.0 = INTEGER: 24
    SNMPv2-SMI::enterprises.318.1.1.4.4.2.1.1.1 = INTEGER: 1
    SNMPv2-SMI::enterprises.318.1.1.4.4.2.1.1.2 = INTEGER: 2
    SNMPv2-SMI::enterprises.318.1.1.4.4.2.1.1.3 = INTEGER: 3
    SNMPv2-SMI::enterprises.318.1.1.4.4.2.1.1.4 = INTEGER: 4
    SNMPv2-SMI::enterprises.318.1.1.4.4.2.1.1.5 = INTEGER: 5
    SNMPv2-SMI::enterprises.318.1.1.4.4.2.1.1.6 = INTEGER: 6
    SNMPv2-SMI::enterprises.318.1.1.4.4.2.1.1.7 = INTEGER: 7
    SNMPv2-SMI::enterprises.318.1.1.4.4.2.1.1.8 = INTEGER: 8
    SNMPv2-SMI::enterprises.318.1.1.4.4.2.1.1.9 = INTEGER: 9
    SNMPv2-SMI::enterprises.318.1.1.4.4.2.1.1.10 = INTEGER: 10
    SNMPv2-SMI::enterprises.318.1.1.4.4.2.1.1.11 = INTEGER: 11
    SNMPv2-SMI::enterprises.318.1.1.4.4.2.1.1.12 = INTEGER: 12
    SNMPv2-SMI::enterprises.318.1.1.4.4.2.1.1.13 = INTEGER: 13
    SNMPv2-SMI::enterprises.318.1.1.4.4.2.1.1.14 = INTEGER: 14
    SNMPv2-SMI::enterprises.318.1.1.4.4.2.1.1.15 = INTEGER: 15
    SNMPv2-SMI::enterprises.318.1.1.4.4.2.1.1.16 = INTEGER: 16
    SNMPv2-SMI::enterprises.318.1.1.4.4.2.1.1.17 = INTEGER: 17
    SNMPv2-SMI::enterprises.318.1.1.4.4.2.1.1.18 = INTEGER: 18
    SNMPv2-SMI::enterprises.318.1.1.4.4.2.1.1.19 = INTEGER: 19
    SNMPv2-SMI::enterprises.318.1.1.4.4.2.1.1.20 = INTEGER: 20
    SNMPv2-SMI::enterprises.318.1.1.4.4.2.1.1.21 = INTEGER: 21
    SNMPv2-SMI::enterprises.318.1.1.4.4.2.1.1.22 = 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.3.6.1.2.1.1.9.1.3.1 = STRING: "The MIB Module from SNMPv2 entities"
    iso.3.6.1.2.1.1.9.1.3.2 = STRING: "SNMP Management Architecture MIB"
    iso.3.6.1.2.1.1.9.1.3.3 = STRING: "Message Processing and Dispatching MIB"
    iso.3.6.1.2.1.1.9.1.3.4 = STRING: "USM User MIB"
    iso.3.6.1.2.1.1.9.1.3.5 = STRING: "VACM MIB"
    iso.3.6.1.2.1.1.9.1.4.1 = Timeticks: (0) 0:00:00.00
    iso.3.6.1.2.1.1.9.1.4.2 = Timeticks: (0) 0:00:00.00
    iso.3.6.1.2.1.1.9.1.4.3 = Timeticks: (0) 0:00:00.00
    iso.3.6.1.2.1.1.9.1.4.4 = Timeticks: (0) 0:00:00.00
    iso.3.6.1.2.1.1.9.1.4.5 = Timeticks: (0) 0:00:00.00
    iso.3.6.1.2.1.2.1.0 = INTEGER: 2
    iso.3.6.1.2.1.2.2.1.1.1 = INTEGER: 1
    iso.3.6.1.2.1.2.2.1.1.2 = INTEGER: 2
    iso.3.6.1.2.1.2.2.1.2.1 = STRING: "LOOPBACK"
    iso.3.6.1.2.1.2.2.1.2.2 = STRING: "lance"
    iso.3.6.1.2.1.2.2.1.3.1 = INTEGER: 24
    iso.3.6.1.2.1.2.2.1.3.2 = INTEGER: 6
    iso.3.6.1.2.1.2.2.1.4.1 = INTEGER: 1500
    ...

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

  • ipicKedawinna
    Angela
    =S= Representative
    Angela 8 days ago (in response to Thomas)

    Thanks for looping back and sharing what you found.

  • insertcoin
    Thomas
    Novice Novice
    Thomas 7 days ago (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). 

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