Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Updated: APCUPSD Script/Template

 
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates
Author Message
Karride



Joined: 27 Jun 2006
Posts: 3
Location: Memphis, TN

PostPosted: Tue Jun 27, 2006 10:39 am    Post subject: Updated: APCUPSD Script/Template Reply with quote

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
Back to top
Karride



Joined: 27 Jun 2006
Posts: 3
Location: Memphis, TN

PostPosted: Tue Jun 27, 2006 11:11 am    Post subject: Reply with quote

Aha! figures as soon as I posted this I would figure it out. line breaks in the poller script were messing it up.
Back to top
diernanet



Joined: 28 Jun 2006
Posts: 1

PostPosted: Wed Jun 28, 2006 3:57 am    Post subject: Reply with quote

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?
Back to top
Karride



Joined: 27 Jun 2006
Posts: 3
Location: Memphis, TN

PostPosted: Wed Jun 28, 2006 7:37 am    Post subject: Reply with quote

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]



graph.gif
 Description:
 Filesize:  21.94 KB
 Viewed:  13159 Time(s)

graph.gif



apcupsd.zip
 Description:

Download
 Filename:  apcupsd.zip
 Filesize:  6.78 KB
 Downloaded:  1801 Time(s)

Back to top
lanyao



Joined: 14 Dec 2005
Posts: 8

PostPosted: Fri Jul 07, 2006 3:24 am    Post subject: Reply with quote

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?
Back to top
sllywhtboy



Joined: 09 Jul 2006
Posts: 40
Location: detroit'ish

PostPosted: Fri Jul 28, 2006 3:16 am    Post subject: Reply with quote

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
Back to top
jantman



Joined: 30 Jan 2007
Posts: 20

PostPosted: Tue Jan 30, 2007 5:53 pm    Post subject: Reply with quote

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.
Back to top
jantman



Joined: 30 Jan 2007
Posts: 20

PostPosted: Tue Jan 30, 2007 6:12 pm    Post subject: Reply with quote

Ok, upgraded from the tarball, working fine now under 0.8.6j
Back to top
westcoastirl



Joined: 20 Oct 2008
Posts: 6

PostPosted: Mon Oct 20, 2008 4:18 am    Post subject: Reply with quote

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.
Back to top
BSOD2600
Cacti Moderator


Joined: 08 May 2004
Posts: 8822
Location: WA, USA

PostPosted: Mon Oct 20, 2008 1:23 pm    Post subject: Reply with quote

Ya'll realize I created a APCUPSD script/templates over a year ago? http://forums.cacti.net/viewtopic.php?p=112578
Back to top
tamias



Joined: 16 Oct 2008
Posts: 49

PostPosted: Tue Nov 11, 2008 6:48 am    Post subject: Reply with quote

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
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 3444
Location: United Kingdom

PostPosted: Mon Nov 17, 2008 3:25 am    Post subject: Reply with quote

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
Back to top
borja.arranz



Joined: 06 Feb 2009
Posts: 9

PostPosted: Fri Feb 06, 2009 7:43 am    Post subject: Please help with APC and Cacti Reply with quote

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]
Back to top
Xi0N



Joined: 06 Jul 2009
Posts: 25

PostPosted: Fri Jul 17, 2009 2:52 pm    Post subject: Reply with quote

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!
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group