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
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