Ad Widget

Collapse

Trigger for UPS

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Lovespider
    Member
    • Sep 2004
    • 99

    #1

    Trigger for UPS

    Hello,
    APC UPS can be monitored via SNMP if they have a NIC installed.
    I'm using the "upsBasicStateOutputState" value that returns a 64 chars string representing a binary set of flags (OID is .1.3.6.1.4.1.318.1.1.1.11.1.0).
    I try to explain better: all charachters can be 0 or 1, depending of the position in this string, they mean different things (I report only the first 4):

    Flag 1: Abnormal Condition Present
    Flag 2: On Battery
    Flag 3: Low Battery
    Flag 4: On Line

    etc etc etc

    Problem: if I want to set a trigger for the "On Battery" status I should check the 4th flag but the triggers' formula does not have a mid$ left$ or right$ like in BASIC language for instance.
    Do you have an idea how to solve it?

    B/R Lovespider
  • sauron
    Senior Member
    • Jan 2005
    • 215

    #2
    Use digit value. Four flag is 16 ( 2 in 4 ).

    Comment

    • Lovespider
      Member
      • Sep 2004
      • 99

      #3
      How? the SNMP returns only a string not a value.

      Comment

      • antifuchs
        Junior Member
        • Apr 2005
        • 7

        #4
        Originally posted by Lovespider
        How? the SNMP returns only a string not a value.
        I don't think that's easy to do, then. You /could/ check for every possible permutation of the string, but I don't think that's a good idea. You could either nag Alexei for a regex-type match function, or look for a different OID to base the check on.

        Don't APC UPSes support the UPS management MIB via .1.3.6.1.2.1.33? the gauge UPS-MIB::upsAlarmsPresent.0 looks like a very useful thing to test for, if your UPS supports it.

        Comment

        • Lovespider
          Member
          • Sep 2004
          • 99

          #5
          Mmmh, my UPS doesn't support that MIB branch. By the way I found this OID: .1.3.6.1.4.1.318.1.1.1.4.1.1.0

          ## According to the APC Powernet MIB the variable .1.3.6.1.4.1.318.1.1.1.4.1.1
          ## takes the the following values: unknown(1), onLine(2), onBattery(3),
          ## onSmartBoost(4), timedSleeping(5), softwareBypass(6), off(7), rebooting(8),
          ## switchedBypass(9), hardwareFailureBypass(10), sleepingUntilPowerReturn(11),
          ## and onSmartTrim(12), where onLine(2) is the normal state for the UPS

          Thanks for support.
          Last edited by Lovespider; 21-04-2005, 11:56.

          Comment

          • rekeds
            Junior Member
            • Feb 2014
            • 21

            #6
            the .1.3.6.1.4.1.318.1.1.1.4.1.1.0 will not help to detect "battery not installed".

            Comment

            Working...