Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Thu May 25, 2017 10:47 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 60 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: APC UPS Daemon (apcupsd) via NIS [v1.1 2007-12-17]
PostPosted: Thu Oct 04, 2007 6:22 pm 
Offline
Cacti Moderator
User avatar

Joined: Sat May 08, 2004 12:44 pm
Posts: 12116
Location: USA
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


Attachments:
File comment: Script/templates
Apcupsd 1.1.zip [33.04 KiB]
Downloaded 2224 times
apc_sample.png
apc_sample.png [ 26.24 KiB | Viewed 30224 times ]

_________________

| 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 |


Last edited by BSOD2600 on Sun Feb 10, 2008 2:08 am, edited 1 time in total.
Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 18, 2007 2:52 am 
Offline
Cacti Moderator
User avatar

Joined: Sat May 08, 2004 12:44 pm
Posts: 12116
Location: USA
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 |


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 15, 2008 9:14 pm 
Offline

Joined: Wed Dec 22, 2004 11:52 am
Posts: 5
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!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 15, 2008 11:23 pm 
Offline

Joined: Wed Dec 22, 2004 11:52 am
Posts: 5
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!


Ahem, just noticed the updated version was exported with 0.8.7a. :-/


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 09, 2008 8:29 pm 
Offline

Joined: Sun Oct 28, 2007 3:31 am
Posts: 34
Location: St. Pete, FL
hmpf, I'm getting all nans on this.....


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 09, 2008 8:51 pm 
Offline

Joined: Sun Oct 28, 2007 3:31 am
Posts: 34
Location: St. Pete, FL
Poller is giving this error:
ERROR: Not enough arguments

Tried manually setting all the arguments on the data input methods, still throws that error.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 10, 2008 2:07 am 
Offline
Cacti Moderator
User avatar

Joined: Sat May 08, 2004 12:44 pm
Posts: 12116
Location: USA
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:
Code:
Script: c:/php/php.exe C:/iis/cacti/scripts/query_apcupsd.php quad 3551
RRD: C:\iis\cacti\rra\quad_apc_stat.rrd


If you have those 2 arguments for the query_apcupsd.php script, try manually running it and see what it spits out.

_________________

| 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 |


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 10, 2008 2:13 am 
Offline

Joined: Sun Oct 28, 2007 3:31 am
Posts: 34
Location: St. Pete, FL
I think I have it figured out, but no clue on how to fix it.
Poller debug:

Code:
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'


and your request:
Code:
Script Server: /home/xaos/public_html/cacti/scripts/query_apcupsd.php localhost 3551
   RRD: /home/xaos/public_html/cacti/rra/pandora_battv_113.rrd


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.
Code:
Script: php /home/xaos/public_html/cacti/scripts/smartcheck.php /dev/sda
   RRD: /home/xaos/public_html/cacti/rra/pandora_smartmontemp_98.rrd


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 10, 2008 2:32 am 
Offline

Joined: Sun Oct 28, 2007 3:31 am
Posts: 34
Location: St. Pete, FL
aha, cleared the poller cache and everything looks good..... waiting on the next poller interval.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 10, 2008 2:56 am 
Offline

Joined: Sun Oct 28, 2007 3:31 am
Posts: 34
Location: St. Pete, FL
omg, I should do that more often when things break!!!

Still getting some nans now, but that looks to be a fault with my APC not reporting those variables.


Attachments:
graph_image.php.png
graph_image.php.png [ 33.3 KiB | Viewed 29283 times ]
Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 10, 2008 4:38 pm 
Offline
Cacti Moderator
User avatar

Joined: Sat May 08, 2004 12:44 pm
Posts: 12116
Location: USA
Chaosratt wrote:
Still getting some nans now, but that looks to be a fault with my APC not reporting those variables.

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...

_________________

| 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 |


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 11, 2008 3:16 pm 
Offline

Joined: Wed Dec 22, 2004 11:52 am
Posts: 5
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. :)


Attachments:
File comment: Battery charge
apc-battery2.png
apc-battery2.png [ 20.65 KiB | Viewed 29229 times ]
File comment: Main UPS status, minus charge.
apc-battery1.png
apc-battery1.png [ 44.55 KiB | Viewed 29229 times ]
File comment: Line voltage
apc-line.png
apc-line.png [ 33.87 KiB | Viewed 29229 times ]
Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 11, 2008 3:47 pm 
Offline

Joined: Sun Oct 28, 2007 3:31 am
Posts: 34
Location: St. Pete, FL
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.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 11, 2008 4:01 pm 
Offline
Cacti Moderator
User avatar

Joined: Sat May 08, 2004 12:44 pm
Posts: 12116
Location: USA
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 |


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 11, 2008 4:20 pm 
Offline

Joined: Sun Oct 28, 2007 3:31 am
Posts: 34
Location: St. Pete, FL
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 60 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: Exabot [Bot] and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group