My script:
Code: Select all
#!/usr/bin/perl
$_ = `/usr/bin/nc localhost 7634`;
@tab = split(/\|/);
print "hde:$tab[3] hdg:$tab[8]";
Code: Select all
# ./hddtemp.pl
hde:35 hdg:38
Code: Select all
04/28/2005 01:00:02 PM - CACTID: Poller[0] Host[1] SCRIPT: perl /usr/share/webapps/cacti-0.8.6d/scripts/hddtemp.pl, output: hde:35 hdg:38
Code: Select all
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="HDD Temp" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="" \
DEF:a="/usr/share/webapps/cacti-0.8.6d/rra/localhost_hdg_26.rrd":hde:AVERAGE \
DEF:b="/usr/share/webapps/cacti-0.8.6d/rra/localhost_hdg_26.rrd":hdg:AVERAGE \
LINE2:a#FF0000:"Samsung - /dev/hde" \
GPRINT:a:LAST:"%8.2lf %s\n" \
LINE2:b#35962B:"Seagate - /dev/hdg" \
GPRINT:b:LAST:"%8.2lf %s\n"
variable hde have "nan" value!