[hobbit] CUSTOM RRD DATA VIA SCRIPTS

Gada, Subhash subhash.gada at logicacmg.com
Thu Mar 16 05:57:58 CET 2006


Hi Greg,

I Apologise for bothering you all with script debugging!

I thought of the following script, however I could not debug the script.
I have the following questions?

I thought of taking advantage of the common letters PRN and grep it with
"PRN*". Is this the correct way to grep the value?

Example data from server1
PRN327:0
PRN203:1
PRN202:0

Example data from server2
PRN123:3 #-----------------------name:value
PRN314:0
PRN137:0
PRN136:0

The idea is to create separate rrd files of each value.
The host which send the data to hobbit does not  have a fixed number of
name:values but maximum of 30

If I trigger the script with hobbd_rrd nothing is happening and the CPU
utilisation is growing up to 90%

Around 25 hosts have the test "printq" running.
 


#!/bin/sh
 
# Input parameters: Hostname, testname (column), and messagefile
HOSTNAME="$1"
TESTNAME="$2"
FNAME="$3"
 
index=0
if [ "$TESTNAME" = "printq" ]
then
# For test purpose looping fixed number of times.
while [ $index  -lt 30  ]
do
p[index]=`grep "^PRN*:" $FNAME | awk '{print $2}'`
 

# The RRD dataset definitions
echo "DS:$index:GAUGE:600:0:U"
 
# The filename
echo "printq.$index.rrd"
 
 #The data
        echo ${p[index]}
let index=$index+1
 
#exit the loop when the value of $p{[index]} is null
if [ $p{[index]}  -eq "" ]
then    
exit
fi
done
        fi
        exit 0


Regards
Subhash




-----Original Message-----
From: Hubbard, Greg L [mailto:greg.hubbard at eds.com] 
Sent: Wednesday, March 15, 2006 9:37 PM
To: hobbit at hswn.dk
Subject: RE: [hobbit] CUSTOM RRD DATA VIA SCRIPTS

Well, it does not appear to be that difficult.  For each data element,
you need to put out the DS line, then the file name, then the values.
Make the file name match the element.

So, if F070 = 1, F001 = 2, F037 = 5

"DS:value:GAUGE:600:0:U"
"F070.rrd"
"1"
"DS:value:GAUGE:600:0:U"
"F001.rrd"
"2"
"DS:value:GAUGE:600:0:U"
"F037.rrd"
"5"

The Hobbit RRD support will do the right thing, creating these datasets
in the directory for the associated host.

Then, in the Hobbit graph definition, you have to figure out how to use
the wildcard mechanism to find all the F*.rrd files.  The file names can
be used to replace the parameter value "value" in the dataset would
become F070, F001, F037, etc.  This seems to be how the disk magic
works.

Good luck!

GLH


-----Original Message-----
From: Werner (Ext Lists) [mailto:wmlist_ext at terra.com.br]
Sent: Wednesday, March 15, 2006 6:09 AM
To: hobbit at hswn.dk
Subject: Re: [hobbit] CUSTOM RRD DATA VIA SCRIPTS

Hi
	You can see the disk rrd handler in
<source_code_home_dir>hobbitd/rrd/do_disk.c , who`s an include to
hobbitd/rrd/do_rrd.c

	-wm

On Wed, 15 Mar 2006 12:47:17 +0530
"Gada, Subhash" <subhash.gada at logicacmg.com> wrote:

> Hi,
>  
> Yes the graph mechanism of disk suites similarly to the requirement.
>  
> Can any one explain how the the separate rrd files are created for 
> different disk volumes. I couldn't  trace how this is happening.
>  
>  
> 
> Regards
> Subhash
> 
> 

To unsubscribe from the hobbit list, send an e-mail to
hobbit-unsubscribe at hswn.dk



To unsubscribe from the hobbit list, send an e-mail to
hobbit-unsubscribe at hswn.dk




This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.



More information about the Xymon mailing list