<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>CUSTOM RRD DATA VIA SCRIPTS</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1528" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=462491506-14032006><FONT face=Arial
size=2>Hi,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=462491506-14032006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=462491506-14032006><FONT face=Arial
size=2>May be I need to put this more clearly.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=462491506-14032006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=462491506-14032006><FONT face=Arial
size=2>Few custom test are running on the host side on windows systems
which measures print queue length of the print server.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=462491506-14032006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=462491506-14032006><FONT face=Arial
size=2>Hobbit is receiving data in the following format from the host
systems.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=462491506-14032006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=462491506-14032006><FONT face=Arial
size=2>From Server 1 </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=462491506-14032006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=462491506-14032006>3/13/2006 Total queued
jobs: 0<FONT face="Times New Roman" size=3> <BR></FONT><FONT face=Arial
size=2>PRN324:0</FONT><FONT face="Times New Roman" size=3> <BR></FONT><FONT
face=Arial size=2>PRN323:0</FONT><FONT face="Times New Roman" size=3>
<BR></FONT><FONT face=Arial size=2>PRN142:0</FONT><FONT face="Times New Roman"
size=3> <BR></FONT><FONT face=Arial size=2>PRN141:0</FONT><FONT
face="Times New Roman" size=3> <BR></FONT><FONT face=Arial
size=2>PRN140:0</FONT><FONT face="Times New Roman" size=3> <BR></FONT><FONT
face=Arial size=2>PRN139:0</FONT><FONT face="Times New Roman" size=3>
<BR></FONT><FONT face=Arial size=2>PRN138:0</FONT><FONT face="Times New Roman"
size=3> </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=462491506-14032006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=462491506-14032006>From server
2</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=462491506-14032006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=462491506-14032006>3/13/2006 Total
queued jobs: 0<FONT face="Times New Roman" size=3> <BR></FONT><FONT face=Arial
size=2>PRN327:0</FONT><FONT face="Times New Roman" size=3> <BR></FONT><FONT
face=Arial size=2>PRN203:0</FONT><FONT face="Times New Roman" size=3>
<BR></FONT><FONT face=Arial size=2>PRN202:0</FONT><FONT face="Times New Roman"
size=3> </FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=462491506-14032006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=462491506-14032006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=462491506-14032006>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). T</SPAN></FONT><FONT face=Arial size=2><SPAN
class=462491506-14032006>he 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</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=462491506-14032006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=462491506-14032006>How can I make the
script dynamic ?</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=462491506-14032006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=462491506-14032006>#!/bin/sh</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=462491506-14032006># Input parameters:
Hostname, testname (column), and
messagefile<BR>HOSTNAME="$1"<BR>TESTNAME="$2"<BR>FNAME="$3"</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=462491506-14032006>if [ "$TESTNAME" =
"printq" ]<BR>then</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=462491506-14032006>p1=`grep "^PRN327:"
$FNAME | awk '{print $2}'`<BR>p2=`grep "^PRN203:" $FNAME | awk '{print
$2}'`<BR>p3=`grep "^PRN202:" $FNAME | awk '{print $2}'`</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=462491506-14032006># The RRD dataset
definitions<BR>echo "DS:p1:GAUGE:600:0:U"<BR>echo "DS:p2:GAUGE:600:0:U"<BR>echo
"DS:p3:GAUGE:600:0:U"</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=462491506-14032006># The
filename<BR>echo "printq.rrd"</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=462491506-14032006># The
data<BR> echo
"$p1:$p2:$p3"<BR>
fi<BR></SPAN></FONT><FONT face=Arial size=2><SPAN
class=462491506-14032006> exit
0</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=462491506-14032006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=462491506-14032006>And how can I make
the configuration even dynamic in the hobbitgraph.cfg</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=462491506-14032006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=462491506-14032006><FONT
color=#0000ff><FONT
color=#000000>[printq]<BR> TITLE Print
Queue Status<BR> YAXIS Print Queue
Length<BR>
DEF:p1=printq.rrd:PRN327:AVERAGE<BR>
DEF:p2=printq.rrd:PRN203:AVERAGE<BR>
DEF:p3=printq.rrd:PRN202:AVERAGE<BR>
AREA:p1#00FF00: PRN
327<BR> GPRINT:p1:LAST: \: %5.1lf
(cur)<BR> GPRINT:p1:MAX: \: %5.1lf
(max)<BR> GPRINT:p1:MIN: \: %5.1lf
(min)<BR> GPRINT:p1:AVERAGE: \: %5.1lf
(avg)\n<BR>
AREA:p2#FF0000: PRN
230<BR> GPRINT:p2:LAST: \: %5.1lf
(cur)<BR> GPRINT:p2:MAX: \: %5.1lf
(max)<BR> GPRINT:p2:MIN: \: %5.1lf
(min)<BR> GPRINT:p2:AVERAGE: \: %5.1lf
(avg)\n<BR>
AREA:p3#0000FF: PRN
202<BR> GPRINT:p3:LAST: \: %5.1lf
(cur)<BR> GPRINT:p3:MAX: \: %5.1lf
(max)<BR> GPRINT:p3:MIN: \: %5.1lf
(min)<BR> GPRINT:p3:AVERAGE: \: %5.1lf
(avg)\n<BR></FONT></FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=462491506-14032006><FONT
color=#0000ff><FONT color=#000000>Please let me know, if more information is
required.</FONT></FONT><BR></DIV></SPAN></FONT>
<DIV><FONT face=Arial size=2><SPAN
class=462491506-14032006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial>Regards</FONT> <BR><FONT face=Arial size=2>Subhash</FONT>
<BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Gada, Subhash
[mailto:subhash.gada@logicacmg.com] <BR><B>Sent:</B> Monday, March 13, 2006 5:23
PM<BR><B>To:</B> hobbit@hswn.dk<BR><B>Subject:</B> [hobbit] CUSTOM RRD DATA VIA
SCRIPTS<BR></FONT><BR></DIV>
<DIV></DIV><!-- Converted from text/rtf format --><BR>
<P><FONT face=Arial size=2>Hi,</FONT> </P>
<P><FONT face=Arial size=2>We have few custom tests that measures printq of the
print server (windows).</FONT> </P>
<P><FONT face=Arial size=2>How can I write a script to create a rrd file and
generate graphs.</FONT> </P>
<P><FONT face=Arial size=2>For example</FONT> </P>
<P><FONT face=Arial size=2>P Server 1 </FONT><BR><FONT face=Arial
size=2>3/13/2006 Total queued jobs: 0</FONT> <BR><FONT face=Arial
size=2>PRN324:0</FONT> <BR><FONT face=Arial size=2>PRN323:0</FONT> <BR><FONT
face=Arial size=2>PRN142:0</FONT> <BR><FONT face=Arial size=2>PRN141:0</FONT>
<BR><FONT face=Arial size=2>PRN140:0</FONT> <BR><FONT face=Arial
size=2>PRN139:0</FONT> <BR><FONT face=Arial size=2>PRN138:0</FONT> </P>
<P><FONT face=Arial size=2>P Server 2</FONT> <BR><FONT face=Arial
size=2>3/13/2006 Total queued jobs: 0</FONT> <BR><FONT face=Arial
size=2>PRN314:0</FONT> <BR><FONT face=Arial size=2>PRN137:0</FONT> <BR><FONT
face=Arial size=2>PRN136:0</FONT> </P>
<P><FONT face=Arial size=2>How to count the number of columns that vary from
host to host.</FONT> </P>
<P><FONT face=Arial size=2>The column names are not common for all the
hosts.</FONT> </P>
<P><FONT face=Arial size=2>Can any one help me further ?</FONT> </P>
<P><FONT face=Arial color=#0000ff size=2>if [ "$TESTNAME"="printq"
]<BR>then<BR></FONT><BR><FONT face=Arial color=#0000ff size=2>p1=`grep
"^</FONT><FONT face=Arial color=#ff0000 size=2>PRN*</FONT><FONT face=Arial
color=#0000ff size=2>:" $FNAME | awk '{print $2}'`<BR>p2=`grep "^</FONT><FONT
face=Arial color=#ff0000 size=2>PRN*</FONT><FONT face=Arial color=#0000ff
size=2>:" $FNAME | awk '{print $2}'`<BR>p3=`grep "^</FONT><FONT face=Arial
color=#ff0000 size=2>PRN*</FONT><FONT face=Arial color=#0000ff size=2>:" $FNAME
| awk '{print $2}'` </FONT></P>
<P><FONT face=Arial color=#0000ff size=2># The RRD dataset definitions<BR>echo
"DS:p1:GAUGE:600:0:U"<BR>echo "DS:p2:GAUGE:600:0:U"<BR>echo
"DS:p3:GAUGE:600:0:U" </FONT><BR><FONT face=Arial color=#0000ff size=2># The
filename </FONT><BR><FONT face=Arial color=#0000ff size=2>echo "printq.rrd"
</FONT><BR><FONT face=Arial color=#0000ff size=2># The data<BR>echo
"$p1:$p2:$p3"<BR></FONT><BR><FONT face=Arial color=#000000> Regards,</FONT>
<BR><FONT face=Arial color=#000000 size=2> Subhash Gada</FONT> <BR><FONT
face=Arial color=#000000 size=2> </FONT> </P><BR><BR>
<P align=center><FONT style="BACKGROUND-COLOR: #ffffff">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.</FONT></A></P></BODY></HTML>