graphing

Joshua Krause forums at triadbiz.rr.com
Wed Jul 2 15:27:55 CEST 2008


I have put together a script to monitor a service that we have.  But I am
wondering how do I go about tweaking the script to show multiple graphs on
the same page being that NCV doesn't support it.  I have added a patch for
Split_ncv and I now have 4 separate rrd files in the data/rrd/host directory
but was wondering if I need to try and modify the script to do the graphing
itself or should I try and use the extra-rrd.pl if possible.  Any help
greatly appreciated?

 

Here is a snippet of the script:

#!/bin/bash

 

COLUMN=startover

RTA_COLOR=green

 

#rtafile="/opt/hobbit/client/logs/twctools.log"

#file=`echo $rtafile | awk '{split ($0, a, " "); print a[1]}'`

#`cat $file | egrep "RSreq">/opt/hobbit/client/logs/rtastats`

 

file="/usr/local/mystro/scripts/twctools/rtaStats/lastRtaUpdate"

#file="/opt/hobbit/client/logs/rtastats"

 

exec<$file

while read line

do

 

 

RSreq=`cat $file | awk '{split ($0, a, "- "); print a[2]}'`

RSreq=`echo $RSreq | awk '{split ($0, a, ", "); print a[1]}'`

 

RSsuc=`cat $file | awk '{split ($0, a, "- "); print a[3]}'`

RSsuc=`echo $RSsuc | awk '{split ($0, a, ", "); print a[1]}'`

 

RSrun=`cat $file | awk '{split ($0, a, "- "); print a[4]}'`

RSrun=`echo $RSrun | awk '{split ($0, a, ", "); print a[1]}'`

 

SuccRt=`cat $file | awk '{split ($0, a, "- "); print a[7]}'`

SuccRt=`echo $SuccRt | awk '{split ($0, a, ", "); print a[1]}'`

 

 

done

 

######################################

# SETUP SCORE COLUMN COLOR

######################################

if [ $SuccRt -gt 85 ]

        then

                RTA_COLOR="green"

                MSG="Requested Start-Over Streams : $RSreq

Started Start-Over Streams   : $RSsuc

Running Start-Over Streams   : $RSrun

Start-Over Success Rate      : $SuccRt%"

                FIRST_LINE_MSG="Start-Over is Ok!"

elif [ $SuccRt -lt 50 ]

        then

                RTA_COLOR="red"

                MSG="Requested Start-Over Streams : $RSreq

Started Start-Over Streams : $RSsuc

Running Start-Over Streams : $RSrun

Start-Over Success Rate : $SuccRt%"

                FIRST_LINE_MSG="Start-Over is Down!!!"

else

                RTA_COLOR="yellow"

                MSG="Requested Start-Over Streams : $RSreq

Started Start-Over Streams : $RSsuc

Running Start-Over Streams : $RSrun

Start-Over Success Rate : $SuccRt%"

                FIRST_LINE_MSG="Start-Over is having a problem!"

fi

######################################

 

# Tell Hobbit about it

$BB $BBDISP "status $MACHINE.$COLUMN $RTA_COLOR `date` -  $FIRST_LINE_MSG

 

${MSG}

"

 

exit

 

thanks,

 

 

-Josh

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20080702/9c51e40d/attachment.html>


More information about the Xymon mailing list