[hobbit] Trying to make graphs with bb-roracle.ksh 2.20

Robert Herron robert.herron at gmail.com
Wed Dec 16 00:11:56 CET 2009


Here's what I did:

In hobbitgraph.cfg add these two stanzas:
[oradb]
        FNPATTERN oradb(.*).rrd
        TITLE Oracle Tablespace Utilitzation
        YAXIS % Full
        DEF:p at RRDIDX@=@RRDFN@:pct:AVERAGE
        LINE2:p at RRDIDX@#@COLOR@:@RRDPARAM@
        -u 100
        -l 0
        GPRINT:p at RRDIDX@:LAST: \: %5.1lf (cur)
        GPRINT:p at RRDIDX@:MAX: \: %5.1lf (max)
        GPRINT:p at RRDIDX@:MIN: \: %5.1lf (min)
        GPRINT:p at RRDIDX@:AVERAGE: \: %5.1lf (avg)\n
[oradb1]
        FNPATTERN oradb(.*).rrd
        TITLE Oracle Tablespace Utilitzation
        YAXIS Used(MB)
        DEF:p at RRDIDX@=@RRDFN@:used:AVERAGE
        LINE2:p at RRDIDX@#@COLOR@:@RRDPARAM@
        -l 0
        GPRINT:p at RRDIDX@:LAST:\: %5.1lf (cur)
        GPRINT:p at RRDIDX@:MAX:\: %5.1lf (max)
        GPRINT:p at RRDIDX@:MIN:\: %5.1lf (min)
        GPRINT:p at RRDIDX@:AVERAGE:\: %5.1lf (avg)\n

In hobbitserver.cfg:
  - Add oradb (or whatever you bb-roracle reports as) to the TEST2RRD line
  - Add oradb and oradb1 to the GRAPHS line

In hobbitlaunch.cfg:
  - Add "--extra-script=/home/hobbit/server/ext/extra_rrd.sh
--extra-tests=oradb" to the CMD line in [rrdstatus] stanza
  - Add "--extra-script=/home/hobbit/server/ext/extra_rrd.sh
--extra-tests=oradb" to the CMD line in [rrdata] stanza

Create $BBHOME/server/ext/extra_rrd.sh as:
#!/bin/bash

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

case $TESTNAME in
  oradb) # oradb
        grep " Tablespace " $FNAME | grep -v "Tablespace check disabled" |
while read LINE
        do
          TSNAME=`echo $LINE | awk '{print $4}'`
          TSSIZE=`echo $LINE | awk '{print $6}' | cut -f1 -d"M"`
          #TSPCTUSED=`echo $LINE | awk '{print $9}'|cut -f1 -d"%"|cut -f2
-d">"`
          TSPCTUSED=`echo $LINE | awk '$2 ~ /\&green/ {print $9}; $2 ~
/\&yellow/ {print $10}; $2 ~/\&red/ {print $10}' |cut -f1 -d"%"|cut -f2
-d">"`
          TSUSED=`echo $TSSIZE $TSPCTUSED | awk '{print $1*$2/100}'`

          # The RRD dataset definitions
          echo "DS:pct:GAUGE:1200:0:100"   #heartbeat = 1200 (20 minutes)
since bb-roracle runs 10 minutes -- Setting lower could cause gaps in graphs
          echo "DS:used:GAUGE:1200:0:U"   #heartbeat = 1200 (20 minutes)
since bb-roracle runs 10 minutes -- Setting lower could cause gaps in graphs

          # The filename
          echo "oradb,${TSNAME}.rrd"

          echo "$TSPCTUSED:$TSUSED"

          #echo "$TSNAME pctused=$TSPCTUSED-- used=$TSUSED--" >>
/tmp/oradb.rrd.out  #debug/testing statement
        done

  *)    exit 0
        ;;

esac
exit 0
#end of extra-rrd.sh

---------------

Robert Herron -- the "R.Herron" in bb-roracle.sh revision history.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20091215/3977787f/attachment.html>


More information about the Xymon mailing list