[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FW: [hobbit] CUSTOM RRD DATA VIA SCRIPTS



Hi,
 
May be I need to put this more clearly.
 
Few custom test are running on the host side on windows systems which
measures print queue length of the print server.
 
Hobbit is receiving data in the following format from the host systems.
 
From Server 1 
 
3/13/2006 Total queued jobs: 0 
PRN324:0 
PRN323:0 
PRN142:0 
PRN141:0 
PRN140:0 
PRN139:0 
PRN138:0 
 
From server 2
 
3/13/2006 Total queued jobs: 0 
PRN327:0 
PRN203:0 
PRN202:0 
 
 
Initially I could thought of the following script to create rrd file but
if I use this script the data existing in all the rrd files of different
host is similar as am using the NAMES PRN327, PRN203, PRN202 to capture
the values (different hosts has different names). The length of the
NAMES are also not consistent across the hosts i.e. for server1   7
name:value are sent to hobbit  & for server 2 only 3 name:value
 
How can I make the script dynamic ?
 
#!/bin/sh
 
# Input parameters: Hostname, testname (column), and messagefile
HOSTNAME="$1"
TESTNAME="$2"
FNAME="$3"
 
if [ "$TESTNAME" = "printq" ]
then
 
p1=`grep "^PRN327:" $FNAME | awk '{print $2}'`
p2=`grep "^PRN203:" $FNAME | awk '{print $2}'`
p3=`grep "^PRN202:" $FNAME | awk '{print $2}'`
 
 
# The RRD dataset definitions
echo "DS:p1:GAUGE:600:0:U"
echo "DS:p2:GAUGE:600:0:U"
echo "DS:p3:GAUGE:600:0:U"
 
# The filename
echo "printq.rrd"
 
# The data
        echo "$p1:$p2:$p3"
        fi
       exit 0
 
And how can I make the configuration even dynamic in the hobbitgraph.cfg
 
[printq]
        TITLE Print Queue Status
        YAXIS Print Queue Length
        DEF:p1=printq.rrd:PRN327:AVERAGE
        DEF:p2=printq.rrd:PRN203:AVERAGE
        DEF:p3=printq.rrd:PRN202:AVERAGE
        AREA:p1#00FF00:        PRN 327
        GPRINT:p1:LAST: \: %5.1lf (cur)
        GPRINT:p1:MAX: \: %5.1lf (max)
        GPRINT:p1:MIN: \: %5.1lf (min)
        GPRINT:p1:AVERAGE: \: %5.1lf (avg)\n
        AREA:p2#FF0000:        PRN 230
        GPRINT:p2:LAST: \: %5.1lf (cur)
        GPRINT:p2:MAX: \: %5.1lf (max)
        GPRINT:p2:MIN: \: %5.1lf (min)
        GPRINT:p2:AVERAGE: \: %5.1lf (avg)\n
        AREA:p3#0000FF:        PRN 202
        GPRINT:p3:LAST: \: %5.1lf (cur)
        GPRINT:p3:MAX: \: %5.1lf (max)
        GPRINT:p3:MIN: \: %5.1lf (min)
        GPRINT:p3:AVERAGE: \: %5.1lf (avg)\n

Please let me know, if more information is required.

 
Regards 
Subhash 

________________________________

From: Gada, Subhash [mailto:subhash.gada (at) logicacmg.com] 
Sent: Monday, March 13, 2006 5:23 PM
To: hobbit (at) hswn.dk
Subject: [hobbit] CUSTOM RRD DATA VIA SCRIPTS




Hi, 

We have few custom tests that measures printq of the print server
(windows). 

How can I write a script to create a rrd file and generate graphs. 

For example 

P Server 1 
3/13/2006 Total queued jobs: 0 
PRN324:0 
PRN323:0 
PRN142:0 
PRN141:0 
PRN140:0 
PRN139:0 
PRN138:0 

P Server 2 
3/13/2006 Total queued jobs: 0 
PRN314:0 
PRN137:0 
PRN136:0 

How to count the number of columns that vary from host to host. 

The column names are not common for all the hosts. 

Can any one help me further ? 

if [ "$TESTNAME"="printq" ]
then

p1=`grep "^PRN*:" $FNAME | awk '{print $2}'`
p2=`grep "^PRN*:" $FNAME | awk '{print $2}'`
p3=`grep "^PRN*:" $FNAME | awk '{print $2}'` 

# The RRD dataset definitions
echo "DS:p1:GAUGE:600:0:U"
echo "DS:p2:GAUGE:600:0:U"
echo "DS:p3:GAUGE:600:0:U" 
# The filename 
echo "printq.rrd" 
# The data
echo "$p1:$p2:$p3"

 Regards, 
 Subhash Gada 
  



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.