On Wednesday 19 September 2007, Jason Chambers wrote:
While I'm on my lunch break, I need a little further information about
hobbit_rrd.
It describes the fact that only 1 script can run, but can work for multiple
tests. I'm just wondering how this can be done. The example script shows
multiple data for 1 test. Would you echo the datasets, the file name, and
data repeatedly one after another for each test in 1 script?
Eg,
echo "DS:temperature:GAUGE:120:75:0"
echo "temperature.rrd"
echo "$TEMP"
echo "DS:blowers:GAUGE:100:120:0"
echo "blowers.rrd"
echo "$BLOWERS"
ect...
I use a wrapper script that calls the specific RRD graphing script based on
test name. Below is the shell script I use. Then you just need to configure
your [rrdstatus] hobbitlaunch.cfg section with the
options "--extra-script=$BBHOME/bin/rrd-scripts/rrd-wrapper.sh --extra-tests=wsstat,schealth,dbdisk,mem"
#!/bin/bash
#
# $1 - HostName
# $2 - TestName
# $3 - LogFName
rrdScript="/home/hobbit/server/bin/rrd-scripts"
if [ "$2" == "wsstat" ] ; then
$rrdScript/wsstat-rrd.pl $1 $2 $3
elif [ "$2" == "schealth" ] ; then
$rrdScript/schealth-rrd.pl $1 $2 $3
elif [ "$2" == "dbdisk" ] ; then
$rrdScript/dbdisk-rrd.pl $1 $2 $3
elif [ "$2" == "mem" ] ; then
$rrdScript/memory-rrd.sh $1 $2 $3
else
echo "No script defined for $2"
fi