UPS Monitoring Plugin for Cacti Released

Announcements concerning Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
User avatar
TheWitness
Developer
Posts: 16897
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

UPS Monitoring Plugin for Cacti Released

Post by TheWitness »

All,

I've been spending my off hours recently working on a plugin that allows monitoring of Uninterruptible Power Supplies (UPSes) inside of Cacti.

With the release of Cacti 1.2.24, we have also released that plugin. If you have any UPSes either SNMP or APCUPSD based and would like to monitor them from Cacti, please feed free to download, test and report any issues you have.

APCUPSD is the preferred method, and any UPS that you can monitor using APCUPSD, you can monitor with Cacti. Your Cacti server will need to have APCUPSD's apcaccess command installed to gather the statistics.

We would be interested in any things you find lacking in the plugin and any new ideas to go beyond what is already planned for future release. You can share those thoughts in the GitHub issue tracker and discussion on GitHub.

Download Location: https://github.com/cacti/plugin_apcupsd

Screen shots to follow:
Attachments
APCUPSD1.png
APCUPSD1.png (116.72 KiB) Viewed 3172 times
APCUPSD2.png
APCUPSD2.png (126.4 KiB) Viewed 3172 times
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
Jeeves
Cacti User
Posts: 91
Joined: Wed Jun 12, 2013 6:25 pm

Re: UPS Monitoring Plugin for Cacti Released

Post by Jeeves »

This looks fantastic. I'm not familiar with APCUPSD (most of my experience is with NUT) and not all of my hardware is APC.

Looking at the code superficially; Do you think it's viable to do a NUT-based adaptation? I wouldn't expect this from you, however having laid the foundation I see a bunch of items that look like they could be converted to the NUT-based commands and get the same data.

Without digging in deeply I can't easily tell how much is using features in apcupsd that couldn't be easily adapted to another service providing the same/similar data.

Edit: Nevermind, got around to reading the readme 😄 Apologies.
That said; I've installed it and configured it for a couple of my APCs. I need to figure out how to allow remote access to the apcupsd but other than that, I should be able to report back anything I find.

Thanks for the plugin!
User avatar
Jeeves
Cacti User
Posts: 91
Joined: Wed Jun 12, 2013 6:25 pm

Re: UPS Monitoring Plugin for Cacti Released

Post by Jeeves »

Quick follow-up;

I see my UPS', the older units seem to have all the data, but the newer ones are missing data, however it doesn't appear in APCUPSD, so that's not on the plugin.

However; It looks like the plugin was supposed to create devices and graph the data? Maybe? However, none of these UPS' have matching devices created. I also checked the rra path and there's not been a new directory created.
apc-ups.png
apc-ups.png (25.89 KiB) Viewed 2011 times
User avatar
TheWitness
Developer
Posts: 16897
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: UPS Monitoring Plugin for Cacti Released

Post by TheWitness »

Jeeves,

I've been taking a break from Cacti and just saw this. Did you import the device package and enable the auto-creation of the devices? Also, for this problematic UPS, can you post the content of the command apcaccess on the host monitoring the UPS?

Larry
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
Jeeves
Cacti User
Posts: 91
Joined: Wed Jun 12, 2013 6:25 pm

Re: UPS Monitoring Plugin for Cacti Released

Post by Jeeves »

TheWitness wrote: Sat Jan 27, 2024 7:47 pm Jeeves,

I've been taking a break from Cacti and just saw this. Did you import the device package and enable the auto-creation of the devices? Also, for this problematic UPS, can you post the content of the command apcaccess on the host monitoring the UPS?

Larry
Good Afternoon Larry,
I totally missed the line in the installation markdown about importing the device package. I saw "install like any other plugin" then my eyes glazed over and clearly missed that. I'll go back, import it and I'm sure it will fix the issue. As a safety-belt feature, it might be useful for the plugin to check if the templates exists (in some way) and alert the user that they've been a dummy and skipped a step?

Also; It seems that if I select anything other than "autocreate device on first poll" I cannot re-select "autocreate device on first poll", e.g. if I select "None" then change my mind.


As for the UPS;
APC : 001,027,0658
DATE : 2024-02-01 16:20:35 -0600
HOSTNAME : upsmon
VERSION : 3.14.14 (31 May 2016) debian
UPSNAME : Unit4
CABLE : USB Cable
DRIVER : USB UPS Driver
UPSMODE : Stand Alone
STARTTIME: 2024-01-25 18:03:56 -0600
MODEL : Smart-UPS 1500
STATUS : ONLINE
BCHARGE : 100.0 Percent
TIMELEFT : 6.0 Minutes
MBATTCHG : -1 Percent
MINTIMEL : -1 Minutes
MAXTIME : 0 Seconds
ALARMDEL : 30 Seconds
BATTV : 27.3 Volts
NUMXFERS : 0
TONBATT : 0 Seconds
CUMONBATT: 0 Seconds
XOFFBATT : N/A
STATFLAG : 0x05000008
MANDATE : 2014-12-04
SERIALNO : AS1449221212
NOMBATTV : 24.0 Volts
FIRMWARE : UPS 09.2 / ID=18
END APC : 2024-02-01 16:20:48 -0600
vs. One of the Smart-UPS 1000's;
APC : 001,043,1011
DATE : 2024-02-01 16:22:02 -0600
HOSTNAME : upsmon
VERSION : 3.14.14 (31 May 2016) debian
UPSNAME : Unit2
CABLE : USB Cable
DRIVER : USB UPS Driver
UPSMODE : Stand Alone
STARTTIME: 2024-01-25 18:03:56 -0600
MODEL : Smart-UPS 1000 RM
STATUS : ONLINE
LINEV : 119.5 Volts
LOADPCT : 59.1 Percent
BCHARGE : 100.0 Percent
TIMELEFT : 6.0 Minutes
MBATTCHG : -1 Percent
MINTIMEL : -1 Minutes
MAXTIME : 0 Seconds
OUTPUTV : 119.5 Volts
SENSE : High
DWAKE : -1 Seconds
DSHUTD : 90 Seconds
LOTRANS : 106.0 Volts
HITRANS : 127.0 Volts
RETPCT : 0.0 Percent
ITEMP : 28.8 C
ALARMDEL : 30 Seconds
BATTV : 27.5 Volts
LINEFREQ : 60.0 Hz
LASTXFER : No transfers since turnon
NUMXFERS : 0
TONBATT : 0 Seconds
CUMONBATT: 0 Seconds
XOFFBATT : N/A
SELFTEST : NO
STESTI : 14 days
STATFLAG : 0x05000008
MANDATE : 2010-05-09
SERIALNO : AS1020110302
BATTDATE : 2010-05-09
NOMOUTV : 120 Volts
NOMBATTV : 24.0 Volts
FIRMWARE : 669.19.D USB FW:11.
END APC : 2024-02-01 16:22:23 -0600
I do not know why those values are not listed/available/etc. But it seemed like that would impact any devices created.
User avatar
TheWitness
Developer
Posts: 16897
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: UPS Monitoring Plugin for Cacti Released

Post by TheWitness »

Okay, that was funny. Like any other plugin "except". I think we've both been doing this too long. Anyway, I'll take that output and see if it works for me. Also, that 1500 gives almost no information. APC/Schneider has been de-contenting their UPS' from a reporting perspective. They may have also changed the USB addresses. That'll be a pain and require a bumping of the apcupsd which has not had an update for a while. If you connect it to a Windows box with their power chute installed, do you get more information?

When you run apcaccess from the Cacti host to the host and port, are you getting the same information?
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
Jeeves
Cacti User
Posts: 91
Joined: Wed Jun 12, 2013 6:25 pm

Re: UPS Monitoring Plugin for Cacti Released

Post by Jeeves »

TheWitness wrote: Thu Feb 01, 2024 6:35 pm Okay, that was funny. Like any other plugin "except". I think we've both been doing this too long.
Silly GOTCHAs!
I imported the package, all was successful, but I still do not see any devices being created.

I'm not sure if that is expected because I flubbed the install, or whatnot.
TheWitness wrote: Thu Feb 01, 2024 6:35 pmAnyway, I'll take that output and see if it works for me. Also, that 1500 gives almost no information. APC/Schneider has been de-contenting their UPS' from a reporting perspective.
I am offisite at the moment, but next week I'll test with powerchute. I did test it with my NUT instance, and I believe the same data was retrieved, so I was satisfied that it wasn't a apcupsd issue, but rather a limitation by design. I'll pull out the laptop I was working on at the time and check, I'm sure I kept that data.
When you run apcaccess from the Cacti host to the host and port, are you getting the same information?
The same data is received both locally and remotely.
User avatar
Jeeves
Cacti User
Posts: 91
Joined: Wed Jun 12, 2013 6:25 pm

Re: UPS Monitoring Plugin for Cacti Released

Post by Jeeves »

Here's the data from NUT gathered from the same Smart-UPS 1500:
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 50
battery.runtime: 360
battery.runtime.low: 120
battery.type: PbAc
battery.voltage: 27.3
battery.voltage.nominal: 24.0
device.mfr: American Power Conversion
device.model: Smart-UPS 1500
device.serial: AS144xxxxx
device.type: ups
driver.name: usbhid-ups
driver.parameter.bus: 001
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.parameter.product: Smart-UPS 1500 FW:UPS 09.2 / ID=18
driver.parameter.productid: 0003
driver.parameter.serial: AS144xxxxxx
driver.parameter.synchronous: auto
driver.parameter.vendor: American Power Conversion
driver.parameter.vendorid: 051D
driver.version: 2.8.0
driver.version.data: APC HID 0.98
driver.version.internal: 0.47
driver.version.usb: libusb-1.0.26 (API: 0x1000109)
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.firmware: UPS 09.2 / ID=18
ups.mfr: American Power Conversion
ups.mfr.date: 2014/12/04
ups.model: Smart-UPS 1500
ups.productid: 0003
ups.serial: AS144xxxxxx
ups.status: OL
ups.timer.reboot: -1
ups.timer.shutdown: -1
ups.vendorid: 051d
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest