Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support
It is currently Wed Sep 03, 2014 2:00 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: Updated: APCUPSD Script/Template
PostPosted: Tue Jun 27, 2006 10:39 am 
Offline

Joined: Tue Jun 27, 2006 10:25 am
Posts: 4
Location: Memphis, TN
I'm trying to setup this script to pull UPS information from APCUPSD. I've gotten to the point where I have a graph, but only "Line voltage" shows up. This is my first attempt at a graph, so I'm sure I'm just missing something.

Here is a sample output from the check_ups.sh script when run manually:
line_volt:120.2
load_pct:0.0
b_charge:100.0
time_left:414.0
int_temp:34.6
bat_volt:27.3
line_freq:60.0

Edit: script fixed, three posts down for updated script and templates.


Last edited by Karride on Wed Jun 28, 2006 8:54 am, edited 3 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 27, 2006 11:11 am 
Offline

Joined: Tue Jun 27, 2006 10:25 am
Posts: 4
Location: Memphis, TN
Aha! figures as soon as I posted this I would figure it out. line breaks in the poller script were messing it up.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 28, 2006 3:57 am 
Offline

Joined: Wed Jun 28, 2006 3:42 am
Posts: 1
The cacti graph doesn't update, even the scripts seens to works good and receive the same respons when execute it manualy:
pegasus@galactica$ /var/www/cacti/scripts/check_ups.sh xx.xx.xx.xx 3551

line_volt:232.0
load_pct:22.0
b_charge:100.0
time_left:40.0
bat_volt:26.6
cum_on_bat:10
nom_batv:24.0

Any sugestions?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 28, 2006 7:37 am 
Offline

Joined: Tue Jun 27, 2006 10:25 am
Posts: 4
Location: Memphis, TN
Yeah, the problem was the script was making a newline for each entry, cacti didnt like that, it needs to be all on one line.

Attached is a zip with the working scripts and graph/data templates (my old graph didnt look good, and this one isn't much better, so if you make a better looking graph be sure to upload it).

Oh and credit where credit is due, the scripts came from another post on this board, I simply edited them to work correctly.

[/img]


Attachments:
graph.gif
graph.gif [ 21.94 KiB | Viewed 22655 times ]
apcupsd.zip [6.78 KiB]
Downloaded 2814 times
Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 07, 2006 3:24 am 
Offline

Joined: Wed Dec 14, 2005 9:37 pm
Posts: 8
Karride wrote:
Yeah, the problem was the script was making a newline for each entry, cacti didnt like that, it needs to be all on one line.

Attached is a zip with the working scripts and graph/data templates (my old graph didnt look good, and this one isn't much better, so if you make a better looking graph be sure to upload it).

Oh and credit where credit is due, the scripts came from another post on this board, I simply edited them to work correctly.

[/img]


How did you do that? I can't get any graphs, maybe there are something wrong when I creating the new host??
Do I need to change some "port option" when creating a new host?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 28, 2006 3:16 am 
Offline

Joined: Sun Jul 09, 2006 1:51 am
Posts: 42
Location: detroit'ish
works great, thanks for writing the script :) i did have to make a couple changes for it to work on my system.

i had to update the shell script to reflect where debian's apcaccess is (/sbin instead of /usr/sbin)

both the perl script and shell script had the following on the first line, i had to remove them:
Quote:
Content-Disposition: Attachment


thanks,
--slly


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 30, 2007 5:53 pm 
Offline

Joined: Tue Jan 30, 2007 3:13 pm
Posts: 21
I'm getting an "XML: Hash version does not exist." error when trying to import these under cacti 0.8.6c. This is the latest version that I could find an RPM for under SuSE 9.3.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 30, 2007 6:12 pm 
Offline

Joined: Tue Jan 30, 2007 3:13 pm
Posts: 21
Ok, upgraded from the tarball, working fine now under 0.8.6j


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 20, 2008 4:18 am 
Offline

Joined: Mon Oct 20, 2008 4:08 am
Posts: 6
im having trouble getting this to work. Im using cacti 0.8.7b on ubuntu.

i installed the script and templates as described making changes described above for debian system.

i get all the proper output from apcaccess yet my graph shows up with no data.

my poller status gives this line:
Code:
10/20/2008 10:10:01 AM - CMDPHP: Poller[0] Host[1] DS[27] WARNING: Result from CMD not valid. Partial Result:

and my data source debug gives this:
Code:
/usr/bin/rrdtool create \
/var/lib/cacti/rra/localhost_line_freq_27.rrd \
--step 300  \
DS:line_freq:GAUGE:600:0:100 \
DS:bat_volt:GAUGE:600:0:100 \
DS:b_charge:GAUGE:600:0:100 \
DS:time_left:GAUGE:600:0:500 \
DS:line_volt:GAUGE:600:0:220 \
DS:int_temp:GAUGE:600:0:200 \
DS:load_pct:GAUGE:600:0:100 \
RRA:AVERAGE:0.5:1:500 \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MAX:0.5:1:500 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797 \

when i run the chech_ups.sh script from commandline it returns this error:
Code:
/usr/share/cacti/site/scripts/apcupsd.pl: line 6: syntax error near unexpected token `)'
/usr/share/cacti/site/scripts/apcupsd.pl: line 6: `while(<STDIN>) { '

anyone know whats going on? would love to get this working.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 20, 2008 1:23 pm 
Offline
Cacti Moderator
User avatar

Joined: Sat May 08, 2004 12:44 pm
Posts: 11297
Location: USA
Ya'll realize I created a APCUPSD script/templates over a year ago? http://forums.cacti.net/viewtopic.php?p=112578

_________________

| 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 Nov 11, 2008 6:48 am 
Offline

Joined: Thu Oct 16, 2008 7:12 am
Posts: 49
Help find a bug in the script!
Code:
$ opt/local/share/cacti/scripts/check_ups.sh
/opt/local/share/cacti/scripts/apcupsd.pl: line 6: syntax error near unexpected token `)'
/opt/local/share/cacti/scripts/apcupsd.pl: line 6: `while(<STDIN>) { '


Line 6 is:
Code:
while(<STDIN>) {


In addition I have removed the first lines of both script

_________________
Regards, Michail A.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 17, 2008 3:25 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 4621
Location: United Kingdom
tamias wrote:
Help find a bug in the script!
Code:
$ opt/local/share/cacti/scripts/check_ups.sh
/opt/local/share/cacti/scripts/apcupsd.pl: line 6: syntax error near unexpected token `)'
/opt/local/share/cacti/scripts/apcupsd.pl: line 6: `while(<STDIN>) { '


Line 6 is:
Code:
while(<STDIN>) {


In addition I have removed the first lines of both script


I think by removing the #!/usr/bin/perl from the second script, you are now running it with bash instead of perl. bash doesn't understand perl :-)

_________________
Weathermap 0.97c is out! & QuickTree 0.2. Superlinks is over there now.
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)

Security Notice: CVE-2013-2618 Network Weathermap 0.97a - editor security issues

My System: CentOS5 64 bit, 4 2GHz cores (Intel E5405), 8GB, Cacti 0.8.7e, Spine 0.8.7e, Weathermap 0.98dev, Superlinks 0.8, ReportIt 0.7.1, THold 0.3.9hj, Explain 0.1, Uptime 0.4hj, Realtime 0.36hj, QuickTree 0.2 - 17000 DS, 320 Hosts. 150 seconds poll.


Top
 Profile  
 
 Post subject: Please help with APC and Cacti
PostPosted: Fri Feb 06, 2009 7:43 am 
Offline

Joined: Fri Feb 06, 2009 7:37 am
Posts: 9
Hi I see that your are monitoring perfectly tour APC PDU with Cacti and i having a lot of problems to configure it.

I have on my appliance "Infraestruxure Manager" the SNMP enabled and on my Cacti server i configured apcupsd and all his dependencies.

I want to know how i have to configure "Device" on Cacti for APC monitoring. and how i have to configure the APC appliance.

On cacti i see the APC's templates so i think that only have to configure the device on Cacti.

If you can send me screenshots of your configuration that's help me a lot.
Please contact me

Thank you so much











Karride wrote:
Yeah, the problem was the script was making a newline for each entry, cacti didnt like that, it needs to be all on one line.

Attached is a zip with the working scripts and graph/data templates (my old graph didnt look good, and this one isn't much better, so if you make a better looking graph be sure to upload it).

Oh and credit where credit is due, the scripts came from another post on this board, I simply edited them to work correctly.

[/img]


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 17, 2009 2:52 pm 
Offline

Joined: Mon Jul 06, 2009 1:03 pm
Posts: 36
Im trying to monitor 3 UPS from the same Debian machine, all them connected by USB...
The point is that i am following this howto, and im in the part where you have to modify your /etc/init.d/apcupsd file to make it handle multiple configuration files. The problem is that the example in the page is for a red-hat distro, and i dont have enough knowledgements to "translate" it for making it work with my debian distro...... did anyone implement this on a debian machine? Anyone so kind to share the startup script with me?

Thanks!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 10 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