Updated: APCUPSD Script/Template
Moderators: Developers, Moderators
Updated: APCUPSD Script/Template
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.
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.
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?
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?
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]
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 (21.94 KiB) Viewed 30663 times
-
- apcupsd.zip
- (6.78 KiB) Downloaded 3326 times
How did you do that? I can't get any graphs, maybe there are something wrong when I creating the new host??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]
Do I need to change some "port option" when creating a new host?
-
- Posts: 42
- Joined: Sun Jul 09, 2006 1:51 am
- Location: detroit'ish
- Contact:
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:
--slly
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:
thanks,Content-Disposition: Attachment
--slly
-
- Posts: 6
- Joined: Mon Oct 20, 2008 4:08 am
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:
and my data source debug gives this:
when i run the chech_ups.sh script from commandline it returns this error:
anyone know whats going on? would love to get this working.
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: Select all
10/20/2008 10:10:01 AM - CMDPHP: Poller[0] Host[1] DS[27] WARNING: Result from CMD not valid. Partial Result:
Code: Select all
/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 \
Code: Select all
/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>) { '
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 |
Help find a bug in the script!
Line 6 is:
In addition I have removed the first lines of both script
Code: Select all
$ 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>) { '
Code: Select all
while(<STDIN>) {
Regards, Michail A.
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
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 perltamias wrote:Help find a bug in the script!Line 6 is:Code: Select all
$ 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>) { '
In addition I have removed the first lines of both scriptCode: Select all
while(<STDIN>) {
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
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!)
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!)
-
- Posts: 9
- Joined: Fri Feb 06, 2009 7:37 am
Please help with APC and Cacti
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
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]
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!
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!
Who is online
Users browsing this forum: No registered users and 4 guests