APC UPS SMART 1500 Status Script

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

Moderators: Developers, Moderators

Post Reply
Freezeland
Posts: 3
Joined: Mon Mar 02, 2009 5:48 am

APC UPS SMART 1500 Status Script

Post by Freezeland »

Hello, i've some problems whit implementating a value of a Script to Cacti.
I run Cacti in a Linux Ubuntu Server.

It's the first time i wrote & implementate a bash-script in cacti.
I read some tutorials, but it won't work.

I wrote the following Script to read the APCUPS Smart 1500
i wan't to get the loadpct value from the APCUPS.

Code: Select all

#!/bin/bash
wget -O apcups.txt http://enosrv01/cgi-bin/apcupsd/upsstats.cgi
cat apcups.txt | grep upsload | cut -d ':' -f 1 | cut -d ' ' -f 2 | cut -d '"' -f 2 | cut -d ';' -f 2 | cut -d '=' -f 2  >> upsstate.txt
x=`cat upsstate.txt`
echo $x
exit 0
at the end of the script, i have the value e.x 40.8

then i load both cacti template "data & graph template" from http://forums.cacti.net/about14481.html from the "apcupsd.zip" package.

and deleted the all other datasources under "Templates;Data templates"
and the same under "Collection Methods; Data Input Methods"
and give the absolute path tho the script "sh /usr/share/cacti/apcups.sh"

nothing will be graphed...
all i need is the load_pct value.
please, can anyone help me?

Greeez
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

You'll need to return the value with an associated data source - "48.0" on it's own isn't enough for Cacti to determine what to do with it.

For example, it should return something like "Output:48.0". You would then define a data source that uses "Output".
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
Freezeland
Posts: 3
Joined: Mon Mar 02, 2009 5:48 am

Post by Freezeland »

ss
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests