Xymon Mailing List Archive search

Trying to make graphs with bb-roracle.ksh 2.20

4 messages in this thread

list Fredbo · Mon, 14 Dec 2009 10:16:10 +0100 (CET) ·
Hi all,

I am trying to create customs graphs using tablespaces datas from bb-roracle.ksh (deadcat).

If someone succeeded with this configuration and could give me some tips it will be fine.

I tried to follow xymon help (creating custom graphs) but no graphs appears.

Me Xymon server is a 4.2.3 on Solaris 10 Sparc.


Regards,

Fred.
list Pkc_mls · Tue, 15 Dec 2009 16:58:43 +0100 ·
Hi Fred,
quoted from Fredbo

user-4e32d4b3c04b@xymon.invalid a écrit :
Hi all,

I am trying to create customs graphs using tablespaces datas from bb-roracle.ksh (deadcat).
custom graphs come often in the ML.
If someone succeeded with this configuration and could give me some tips it will be fine.
can you verify if the rrd files are created, and what they contain ?
I tried to follow xymon help (creating custom graphs) but no graphs appears.
start with rrd creation debug. (check for the logs to see if you have
any message regarding rrd).
Me Xymon server is a 4.2.3 on Solaris 10 Sparc.


Regards,
hope this helps.
bon courage.
Fred.
list Robert Herron · Tue, 15 Dec 2009 18:11:56 -0500 ·
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.
list Fredbo · Wed, 16 Dec 2009 09:08:39 +0100 (CET) ·
Many thanks Robert, It works ! 

Just a detail at the end of the script :

####################
29  done
    30  ;; # add two semi-colon here
    31
    32    *)    exit 0
    33          ;;
    34
    35  esac
    36  exit 0
    37  #end of extra-rrd.sh
####################


Best regards.

Fred.
quoted from Robert Herron


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.