APC UPS Daemon (apcupsd) via NIS [v1.1 2007-12-17]

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

kcmjr
Posts: 2
Joined: Mon Feb 23, 2009 12:43 pm

Post by kcmjr »

How difficult would it be to modify the graphs to use the sensors from another set of scripts? I haven't attempted to create any myself yet and am still figuring Cacti out in general. From what I've seen it looks to be a bit work to create them much less to convert them. I like the way these graphs are laid out and would prefer to use them instead of the individual graphs I currently have functioning.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

umm if you want to use different scripts, then you should read the documentation site (link above) on how to make the scripts/templates. not all that complicated.
Xi0N
Posts: 36
Joined: Mon Jul 06, 2009 1:03 pm

Post by Xi0N »

This script works like a charm:

The problem im facing is that i connected 3 UPS to the same machine via USB, and i can make it to monitor one of them.... How can i do it to monitor the three of them? Each one runs in a different NIS port, 3551, 3552 and 3553.

I know they are giving the readings properly manually running the script.

Any idea?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

1) make sure your NIS client can read the separate UPS's on each port.
2) In the APC UPS Data Source for the device, specify the port which it should use.
Xi0N
Posts: 36
Joined: Mon Jul 06, 2009 1:03 pm

Post by Xi0N »

Thanks!! I just had to do them by hand one by one, but just in this moment i made it work perfectly: Three different UPS monitored from the same machine....

Thanks!!!!!!!!
sjturner66
Posts: 13
Joined: Fri Dec 05, 2008 4:06 pm
Location: Santa Clara CA
Contact:

Post by sjturner66 »

I take it, everyone is running the script and template aginst a server that is connected to the serial port of the ups. I'm trying to setup UPS monitoring just using the snmp accesss to the network management card in the ups. Do I need to modify any line in the .php file to do this? What about APCACCESS_PATH. How does this script work when there is no server running the apcupsd? I do have apcupsd in my cacti folder

Thanks,
Steve
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

While this script will work for your SNMP enabled UPS, I strongly recommend you use the snmp UPS script/templates on this forum instead. Less hassle to set up and much quicker.

Yes, every server running a ups you want to monitor must be running apcupsd with NIS for this script to work. Yes, per the installation guide, you must modify the apcaaccess_path.
sjturner66
Posts: 13
Joined: Fri Dec 05, 2008 4:06 pm
Location: Santa Clara CA
Contact:

Post by sjturner66 »

BSOD2600 wrote:While this script will work for your SNMP enabled UPS, I strongly recommend you use the snmp UPS script/templates on this forum instead. Less hassle to set up and much quicker.

Yes, every server running a ups you want to monitor must be running apcupsd with NIS for this script to work. Yes, per the installation guide, you must modify the apcaaccess_path.
Thanks for the info, I too figured it would be simpler to use a script build for just SNMP and the more I searched I found one by Streaker69. Thanks for the help
dimis7
Posts: 2
Joined: Mon Oct 12, 2009 9:23 am

Post by dimis7 »

Hi.
I'm using this template to monitor my symmetra apc ups.
when i run manually the script, i get this data:

Code: Select all

dimis7@cacti:/usr/share/cacti/site/scripts$ php query_apcupsd.php 192.168.1.15 3551
LINEV:230.4 LOADPCT:0.0 BCHARGE:100.0 TIMELEFT:572.0 MAXLINEV:232.1 MINLINEV:230.4 ITEMP:48.2 BATTV:136.5 LINEFREQ:50.0 TONBATT:0 NOMBATTV:120.0dimis7@cacti:/usr/share/cacti/site/scripts$
But in graphs not all data is displayed...

The charge%, load%, internal temp,line freq and line voltege is ok but the battery voltage, nominal battery voltage, remaining time and nominal line voltage is not show on graphs.

what should i check first?

my cacti version is 0.8.7b running on Ubuntu server 8.10

Code: Select all

Data Source Debug

/usr/bin/rrdtool create \
/var/lib/cacti/rra/server_tonbatt_66.rrd \
--step 300  \
DS:LOADPCT:GAUGE:600:0:100 \
DS:BCHARGE:GAUGE:600:0:100 \
DS:TIMELEFT:GAUGE:600:0:700 \
DS:BATTV:GAUGE:600:0:150 \
DS:NOMINV:GAUGE:600:0:250 \
DS:NOMBATTV:GAUGE:600:0:100 \
DS:MAXLINEV:GAUGE:600:0:250 \
DS:MINLINEV:GAUGE:600:0:250 \
DS:ITEMP:GAUGE:600:0:120 \
DS:LINEFREQ:GAUGE:600:0:100 \
DS:TONBATT:GAUGE:600:0:100 \
DS:LINEV:GAUGE:600:0:250 \
RRA:AVERAGE:0.5:1:500 \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:1:1440 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MIN:0.5:1:600 \
RRA:MIN:0.5:6:700 \
RRA:MIN:0.5:24:775 \
RRA:MIN:0.5:288:797 \
RRA:MAX:0.5:1:500 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:1:1440 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797 \
RRA:LAST:0.5:1:600 \
RRA:LAST:0.5:6:700 \
RRA:LAST:0.5:24:775 \
RRA:LAST:0.5:288:797 \
Attachments
upd.PNG
upd.PNG (61.31 KiB) Viewed 7742 times
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

dimis7 wrote:The charge%, load%, internal temp,line freq and line voltege is ok but the battery voltage, nominal battery voltage, remaining time and nominal line voltage is not show on graphs.

what should i check first?
The script merely spits out the parsed results from apcaccess. Manually run the command against your device and see if it spits out those missing fields:

apcaccess status 192.168.1.15:3551
dimis7
Posts: 2
Joined: Mon Oct 12, 2009 9:23 am

Post by dimis7 »

I fix it!!!

The problem was the rrd ds limits...

After i change the limits via Data Templates --> APC UPS Statistics, i had to delete the rrd file and create a new one, to display the results in my graph :lol:
Attachments
ups.PNG
ups.PNG (102.62 KiB) Viewed 7720 times
lightenup
Posts: 19
Joined: Mon Dec 06, 2010 10:09 am

Re: APC UPS Daemon (apcupsd) via NIS [v1.1 2007-12-17]

Post by lightenup »

This template/script works perfectly on 8.7i. Thanks for your great work!
johnnelu
Posts: 1
Joined: Thu May 19, 2011 9:16 am

Re: APC UPS Daemon (apcupsd) via NIS [v1.1 2007-12-17]

Post by johnnelu »

really?
what have i done wrong ?

RRDTool Says:

ERROR: opening '/var/www/localhost/htdocs/cacti/rra/apc_su700xl_linev_276.rrd': No such file or directory
seveny13
Posts: 6
Joined: Mon May 16, 2016 10:28 am

Re: APC UPS Daemon (apcupsd) via NIS [v1.1 2007-12-17]

Post by seveny13 »

Hi there,

with Ubuntu 16.04 there comes PHP7, which caused me some headaches, because I just realized that *after* the upgrade was done and it was too late ;-)

So: The apcupsd-script "query_apcupsd.php" fails.

But: The solution is simple.

In line 66 just replace the "split" (deprecated) command with "explode".

Have fun.

PS: My UPS from APC and cacti (today 0.8.8f) work together perfectly for 10 (!) years now, never had to change anything until now *smile*

Sven
labtec6
Posts: 7
Joined: Fri May 13, 2016 3:33 pm

Re: APC UPS Daemon (apcupsd) via NIS [v1.1 2007-12-17]

Post by labtec6 »

seveny13 wrote:Hi there,

with Ubuntu 16.04 there comes PHP7, which caused me some headaches, because I just realized that *after* the upgrade was done and it was too late ;-)

So: The apcupsd-script "query_apcupsd.php" fails.

But: The solution is simple.

In line 66 just replace the "split" (deprecated) command with "explode".

Have fun.

PS: My UPS from APC and cacti (today 0.8.8f) work together perfectly for 10 (!) years now, never had to change anything until now *smile*

Sven
Just to let you know, you can follow here:

http://askubuntu.com/questions/761713/h ... untu-16-04

And it will let you run PHP 5.6 on Ubuntu 16.04.

If you need to change the PHP command line, do this:

cd /etc/alternatives
sudo rm php
sudo ln -s /usr/bin/php5.6 php
(change php5.6 or php7.0 to switch back)
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests