APC UPS Daemon (apcupsd) via NIS [v1.1 2007-12-17]
Moderators: Developers, Moderators
APC UPS Daemon (apcupsd) via NIS [v1.1 2007-12-17]
Name: apcupsd query
Created by: BSOD2600
Version: 1.1
Cacti: 0.8.7a
Summary: This script is designed to run against a host running the APC UPS Daemon, Apcupsd, with the NIS (Network Information Server) feature enabled. Furthermore, it utilizes the 'apcaccess status' command to remotely query an APC status. This is done primarily for the older APC devices which do not support SNMP. The script will still work for the SNMP enabled devices, but will be a little slower.
Unlike other Apcupsd scripts, this one works on both Windows and Linux Cacti installations. Apcupsd works on both Windows and Linux too.
Changelog:
-1.1
Fixed APC Battery template due to cacti import bug
Exported with cacti 0.8.7a
-1.0
Initial release
Exported with cacti 0.8.6j
Created by: BSOD2600
Version: 1.1
Cacti: 0.8.7a
Summary: This script is designed to run against a host running the APC UPS Daemon, Apcupsd, with the NIS (Network Information Server) feature enabled. Furthermore, it utilizes the 'apcaccess status' command to remotely query an APC status. This is done primarily for the older APC devices which do not support SNMP. The script will still work for the SNMP enabled devices, but will be a little slower.
Unlike other Apcupsd scripts, this one works on both Windows and Linux Cacti installations. Apcupsd works on both Windows and Linux too.
Changelog:
-1.1
Fixed APC Battery template due to cacti import bug
Exported with cacti 0.8.7a
-1.0
Initial release
Exported with cacti 0.8.6j
- Attachments
-
- apc_sample.png (26.24 KiB) Viewed 36264 times
-
- Apcupsd 1.1.zip
- Script/templates
- (33.04 KiB) Downloaded 2973 times
Last edited by BSOD2600 on Sun Feb 10, 2008 2:08 am, edited 1 time in total.
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
New version uploaded which fixes an xml parsing bug in cacti.
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
Ahem, just noticed the updated version was exported with 0.8.7a. :-/khaytsus wrote:I'm using 0.8.6j, but I get the "Error: XML: Hash version does not exist." error on the Battery template.
The Line template imported (and is working) fine! Any ideas? Maybe the 0.8.6j patches?
Thanks for these, they look great!
Go to System Utilities -> Poller Cache Items. Select a device which you've added the APC UPS Statistics query. Post the details. It should look something like:
If you have those 2 arguments for the query_apcupsd.php script, try manually running it and see what it spits out.
Code: Select all
Script: c:/php/php.exe C:/iis/cacti/scripts/query_apcupsd.php quad 3551
RRD: C:\iis\cacti\rra\quad_apc_stat.rrd
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
I think I have it figured out, but no clue on how to fix it.
Poller debug:
and your request:
Doesnt look like its putting php in front of the command. NO clue why, I've set the script type to php, i've put the full binary path in there, everything, it just keeps trying to spit out the file without executing it as a php script.
I've even duplicated everything that my smartmon script has set, and while it gives a good output, the apcupsd one keeps refusing.
Poller debug:
Code: Select all
02/10/2008 02:05:12 AM - PHPSVR: Poller[0] WARNING: Function does not exist
02/10/2008 02:05:12 AM - PHPSVR: Poller[0] DEBUG: INC: '/home/xaos/public_html/cacti/scripts/query_apcupsd.php' FUNC: 'localhost' PARMS: '3551'
02/10/2008 02:05:12 AM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_output (local_data_id, rrd_name, time, output) values (113, '', '2008-02-10 02:05:05', 'U')"
02/10/2008 02:05:12 AM - CMDPHP: Poller[0] Host[1] DS[113] SERVER: /home/xaos/public_html/cacti/scripts/query_apcupsd.php localhost 3551, output: U
02/10/2008 02:05:12 AM - CMDPHP: Poller[0] Host[1] DS[113] WARNING: Result from SERVER not valid. Partial Result: Usage: query_apcupsd
02/10/2008 02:05:12 AM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_output (local_data_id, rrd_name, time, output) values (114, '', '2008-02-10 02:05:05', 'U')"
02/10/2008 02:05:12 AM - CMDPHP: Poller[0] Host[1] DS[114] SERVER: /home/xaos/public_html/cacti/scripts/query_apcupsd.php localhost 3551, output: U
02/10/2008 02:05:12 AM - CMDPHP: Poller[0] Host[1] DS[114] WARNING: Result from SERVER not valid. Partial Result:
02/10/2008 02:05:12 AM - PHPSVR: Poller[0] WARNING: Function does not exist
02/10/2008 02:05:12 AM - PHPSVR: Poller[0] DEBUG: INC: '/home/xaos/public_html/cacti/scripts/query_apcupsd.php' FUNC: 'localhost' PARMS: '3551'
Code: Select all
Script Server: /home/xaos/public_html/cacti/scripts/query_apcupsd.php localhost 3551
RRD: /home/xaos/public_html/cacti/rra/pandora_battv_113.rrd
I've even duplicated everything that my smartmon script has set, and while it gives a good output, the apcupsd one keeps refusing.
Code: Select all
Script: php /home/xaos/public_html/cacti/scripts/smartcheck.php /dev/sda
RRD: /home/xaos/public_html/cacti/rra/pandora_smartmontemp_98.rrd
Correct, each APC device returns a different amount of data. Manually run the script to see what it can pick up. Also, if the script doesn't have a field you want; you can easily add it...Chaosratt wrote:Still getting some nans now, but that looks to be a fault with my APC not reporting those variables.
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
I've modified mine to split out the battery charge and leave the rest, three separate graphs now. Plus I removed a few my BackUPS doesn't support that the SmartUPS do.
Easy to do, all I did was duplicate the existing one and remove some items.
Easy to do, all I did was duplicate the existing one and remove some items.
- Attachments
-
- Line voltage
- apc-line.png (33.87 KiB) Viewed 35269 times
-
- Main UPS status, minus charge.
- apc-battery1.png (44.55 KiB) Viewed 35269 times
-
- Battery charge
- apc-battery2.png (20.65 KiB) Viewed 35269 times
Heh, setting up this script has let me know that my APC is likely bad.
It reports a load of 30% no matter what is plugged into it, and also only 24min of runtime. This is a 750VA unit. The server running this is the only thing normally on this APC, is just a salvaged parts machine, and runs headless.
A brand new 500VA unit that runs my gaming desktop, printer, networking hardware, and two monitors reports over 40min of runtime (the windows software does not report load).
All else fails, I may just swap the two.
It reports a load of 30% no matter what is plugged into it, and also only 24min of runtime. This is a 750VA unit. The server running this is the only thing normally on this APC, is just a salvaged parts machine, and runs headless.
A brand new 500VA unit that runs my gaming desktop, printer, networking hardware, and two monitors reports over 40min of runtime (the windows software does not report load).
All else fails, I may just swap the two.
Chaosratt wrote:It reports a load of 30% no matter what is plugged into it, and also only 24min of runtime.
The lower end BackUPS devices don't always correctly report all of the data apcdaemon reports. Basically if you don't see the data in the official APC Powermonitoring tool, then the data apcdaemon reports, is invalid (so I've found out).
For example my old BackUPS 500, while it reports load, run time, etc the values never change. the official APC tool doesn't report this data either, so I'm fairly sure it's invalid. Where as my newer BackUPS RS-1200 DOES properly report the values (and shows up in the APC tool).
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
Hm, well both of these are normal Backups ES models, using the usb cable. I was too lazy to get apcupsd to monitor 2 (though I saw it could be done) so for now each box just monitors its oun APC. I'm just wondering why the model with the lower capacity reports the higher runtime? The windows box is running the "official" software though.
Who is online
Users browsing this forum: No registered users and 1 guest