Forum Discussion

Neil_Pritchard's avatar
7 years ago

Monitoring of APC UPS without SNMP support

This is a question to see if anyone would like a challenge?  Higher end APC UPS's typically can be monitored over SNMP, however there are many APC device out there in the Home an Small Business office category that do not support SNMP but do have an USB connection.

I have one of these.   I have managed to get some simple monitoring of the UPS using Logicmonior,  a deamon service called APCUPSD  (http://www.apcupsd.org/) and looking at specific window event logs to trigger alerts, Utility Power lost,  Comms Lost etc. 

I found that someone has written a more enhanced monitoring solution using the above Deamon  and Powershell script with the PRTG product.  I would like to replicate this to work with logicmonitor as there is a whole host or additional parameter that the deamon process monitors real time on the UPS.

Anyone have ideas on the best way to achieve this?  better Still anyone fancy having a go?

Neil

 

 

  • @Neil Pritchard out of my own curiosity, what sort of additional metrics are you getting via the daemon as compared to SNMP (if applied to higher end APC's that do support SNMP)?

    Sadly, I don't have an APC UPS at home to mess around with, but it looks like the APCUPSD docs are done well.

  • I would use `apcaccess` from a collector via our Groovy Expect functionality. You'll of course have to also configure apcupsd to listen on something other than localhost.

    You'll get a list of values like this:
     

    DATE     : Fri Dec 03 12:34:26 CET 1999
    HOSTNAME : matou
    RELEASE  : 3.7.0-beta-1
    CABLE    : Custom Cable Smart
    MODEL    : SMART-UPS 1000
    UPSMODE  : Stand Alone
    UPSNAME  : UPS_IDEN
    LINEV    : 232.7 Volts
    MAXLINEV : 236.6 Volts
    MINLINEV : 231.4 Volts
    LINEFREQ : 50.0 Hz
    OUTPUTV  : 232.7 Volts
    LOADPCT  :  11.4 Percent Load Capacity
    BATTV    : 27.7 Volts
    BCHARGE  : 100.0 Percent
    MBATTCHG : 5 Percent
    TIMELEFT : 112.0 Minutes
    MINTIMEL : 3 Minutes
    SENSE    : Low
    DWAKE    : 060 Seconds
    DSHUTD   : 180 Seconds
    LOTRANS  : 204.0 Volts
    HITRANS  : 253.0 Volts
    RETPCT   : 050.0 Percent
    STATFLAG : 0x08 Status Flag
    STATUS   : ONLINE
    ITEMP    : 29.2 C Internal
    ALARMDEL : Low Battery
    LASTXFER : U command or Self Test
    SELFTEST : NO
    STESTI   : 336
    DLOWBATT : 02 Minutes
    DIPSW    : 0x00 Dip Switch
    REG1     : 0x00 Register 1
    REG2     : 0x00 Register 2
    REG3     : 0x00 Register 3
    MANDATE  : 01/05/99
    SERIALNO : GS9902009459
    BATTDATE : 01/05/99
    NOMOUTV  : 230.0
    NOMBATTV :  24.0
    HUMIDITY : N/A
    AMBTEMP  : N/A
    EXTBATTS : 0
    BADBATTS : N/A
    FIRMWARE : 60.11.I
    APCMODEL : IWI
    END APC  : Fri Dec 03 12:34:33 CET 1999

    From there you can transform the values to pull out the extraneous text ("Volts", "Register 1", etc) and reprint it all to our Key/Value output standard, or you can write a few regexes for your datapoints to only pick out the good stuff (less clean, but less code).

    http://www.apcupsd.org/manual/manual.html#monitoring-and-tuning-your-ups

    I'm happy to put this in as an official DataSource request, but I won't have a timeline for you.

    You might also checkout the output from the PowerShell script. It could be just a few simple tweaks to getting it working with LM.
     

  • Hey Neil,

    I took a quick shot at this - making the assumption you were on Windows - so I apologize if you're using another platform. I'm attaching a PowerShell DataSource that remotes (from a collector) into a machine running APCUPSD, and runs the 'apcaccess' command that @Michael Rodrigues mentioned above. This requires wmi.user and wmi.pass to be set as properties on the device that you want to monitor.

    The locator code for APCUPSD_Windows_LMExchange is YFXCYG.

    Cheers,

    Kerry 

     

  • Hi,  Can I firstly apologise for the late reply and to those who have contributed to this topic.  I'm just getting back to look and this.