rrd graph not showing in trends

Matt mlist at cmcflex.com
Mon Jul 2 23:07:26 CEST 2007


Finally kind of figured out this fancy rrd graphing business (oh man is 
it sweet).  Problem though, I can't seem to get my graph to populate in 
the trends column - it will populate in it's own column (should the 
client use the status channel).  Here are the relevant parts of each 
config file.

hobbitgraph.cfg

[fans]
        TITLE Fan Speeds
        YAXIS RPM
        DEF:one=cpufan1.rrd:cpufan1:AVERAGE
        #DEF:cpufan2=cpufan2.rrd:cpufan2:AVERAGE
        GPRINT:one:LAST:CPU0 Fan \: %5.1lf (cur)
        GPRINT:one:MAX: \: %5.1lf (max)
        GPRINT:one:MIN: \: %5.1lf (min)
        GPRINT:one:AVERAGE: \: %5.1lf (avg)\n
        #GPRINT:cpufan2:LAST:CPU1 Fan \: %5.1lf (cur)
        #GPRINT:cpufan2:MAX: \: %5.1lf (max)
        #GPRINT:cpufan2:MIN: \: %5.1lf (min)
        #GPRINT:cpufan2:AVERAGE: \: %5.1lf (avg)\n
        LINE2:one#FF0000:CPU0 Fan
        #LINE2:cpufan2#1048FF:CPU1 Fan


client.script.sh

#!/bin/sh

# Input parameters: Hostname, testname (column), and messagefile
HOSTNAME="$1"
TESTNAME="$2"
FNAME="$3"

if [ "$TESTNAME" = "chassistemp" ];
then
        # Analyze the message we got
        TEMP=`grep "^Temperature:" $FNAME | awk '{print $2}'`
        AGENT1=`grep "^agent1:" $FNAME | awk '{print $2}'`
        AGENT2=`grep "^agent2:" $FNAME | awk '{print $2}'`

        # The RRD dataset definitions
        echo "DS:temperature:GAUGE:600:0:50"

        # The filename
        echo "chassistemp.rrd"

        # The data
        echo "$TEMP"


        echo "DS:agent1:GAUGE:600:0:75"
        echo "chassistemp-agent1.rrd"
        echo "$AGENT1"

        echo "DS:agent2:GAUGE:600:0:75"
        echo "chassistemp-agent2.rrd"
        echo "$AGENT2"

fi
if [ "$TESTNAME" = "fans" ];
then
        # Analyze the message we got
        FAN1=`grep "^cpu1:" $FNAME | awk '{print $2}'`
        FAN2=`grep "^cpu2:" $FNAME | awk '{print $2}'`

        echo "DS:cpufan1:GAUGE:600:712:U"
        echo "cpufan1.rrd"
        echo "$FAN1"

        echo "DS:cpufan2:GAUGE:600:712:U"
        echo "cpufan2.rrd"
        echo "$FAN2"

fi

exit 0


hobbitserver.cfg

TEST2RRD="cpu=la,disk,inode,qtree,memory,$PINGCOLUMN=tcp,http=tcp,dns=tcp,dig=tcp,time=ntpstat,vmstat,
iostat,netstat,temperature,apache,bind,sendmail,mailq,nmailq=mailq,socks,bea,iishealth,citrix,bbgen,bbtest,bbproxy,
hobbitd,files,procs=processes,ports,clock,lines,fans"

# This defines which RRD files to include on the "trends" column webpage,
# and the order in which they appear.
GRAPHS="la,disk,inode,qtree,files,processes,memory,users,vmstat,iostat,tcp.http,tcp,ncv,netstat,ifstat,mrtg::1,ports,
temperature,ntpstat,apache,bind,sendmail,mailq,socks,bea,iishealth,citrix,bbgen,bbtest,bbproxy,hobbitd,lines,chassistemp,
fans"

hobbitlaunch.cfg

[rrdstatus]
        ENVFILE /usr/lib/hobbit/server/etc/hobbitserver.cfg
        NEEDS hobbitd
        CMD hobbitd_channel --channel=status 
--log=$BBSERVERLOGS/rrd-status.log hobbitd_rrd --rrddir=$BBVAR/rrd 
--extra-script=/etc/hobbit/client.script.sh --extra-tests=chassistemp,fans

# "rrddata" updates RRD files with information that arrives as "data" 
messages.
# If you want RRD graphs of your monitoring BB data, then you want to 
run this.

[rrddata]
        ENVFILE /usr/lib/hobbit/server/etc/hobbitserver.cfg
        NEEDS hobbitd
        CMD hobbitd_channel --channel=data 
--log=$BBSERVERLOGS/rrd-data.log hobbitd_rrd --rrddir=$BBVAR/rrd 
--extra-script=/etc/hobbit/client.script.sh --extra-tests=chassistemp,fans

client side script bb-fans.sh

#!/bin/sh

BB=/home/hobbit/client/bin/bb
BBDISP="10.5.0.75"
 
# Column name
TEST=fans
 
# Line name
HOST=ftp2

COLOR=green
MESSAGE="$FAN1
$FAN2"
 
FAN1=$(/usr/sbin/sdt | grep "CPU1 Fan" | awk '{print $5}')
FAN2=$(/usr/sbin/sdt | grep "CPU2 Fan" | awk '{print $5}')

# Prepare to send message
LINE="status $HOST.$TEST $COLOR `date` $MESSAGE"
DATA="data $HOST.$TEST
cpu1: $FAN1
cpu2: $FAN2"

# Send message
# Comment the following line to test
#$BB $BBDISP "$LINE"
$BB $BBDISP "$DATA"


Like I said, if I change the above client-side script to send via status 
channel, I get the graph.  If I leave it on the data channel, I get 
nothing - not even a link to an empty page.

If anyone could shed some light on this I'd appreciate it greatly,

Matt




More information about the Xymon mailing list