That's where the fun begins. :-)<br><br>Let's call your test name oscount (for lack of imagination on my part)<br>
<br>Send all your data to the server in the server using bb as if it was a normal test, but make sure your data is in the format <br>OS-Description-1 : xx<br>OS-Description-2 : yy<br>etc.etc<br><br>You then add oscount=ncv to<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"></span> TEST2RRD= in hobbitserver.cfg and add oscount to GRAPHS=<br>
Same as we do for any new test. See examples on Xymonton<br><br>Then you also add  in hobbitserver.cfg <br>SPLITNCV_oscount="*:GAUGE"<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"></span><br>
<br>Remember to restart your server.<br><br>Creating graph definitions with SPLITNCV is easy.<br>Add this to hobbitgraph.cfg<br><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span class="Apple-style-span" style="font-family: 'Lucida Grande',Verdana,Lucida,Helvetica,Arial,sans-serif; font-size: 13px;"><pre class="code" style="padding: 0.5em; margin: 0px 0px 1em; font-size: 12px; border: 1px dashed rgb(204, 204, 204); color: rgb(0, 0, 0); overflow: auto;">
[oscount]
  FNPATTERN oscount,(.*).rrd
  TITLE Number of instances of OS<br>  YAXIS Number<br>  -l 0
  DEF:p@RRDIDX@=@RRDFN@:lambda:AVERAGE
  LINE2:p@RRDIDX@#@COLOR@:@RRDPARAM@
  GPRINT:p@RRDIDX@:LAST: \: %5.1lf (cur)
  GPRINT:p@RRDIDX@:MAX: \: %5.1lf (max)
  GPRINT:p@RRDIDX@:MIN: \: %5.1lf (min)
  GPRINT:p@RRDIDX@:AVERAGE: \: %5.1lf (avg)\n</pre></span></span>Should start seeing some fun stuff.<br><br>Regards<br>    Vernon<br><br><br>On Tue, Sep 21, 2010 at 5:26 PM, Martin Flemming <span dir="ltr"><<a href="mailto:martin.flemming@desy.de">martin.flemming@desy.de</a>></span> wrote:<br>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><br>
Dear all !<br>
<br>
Perfectly .. it works like a charme .. :-)<br>
<br>
.. one more question and how get them all in one graph ?<br>
<br>
thanks a lot & cherrs,<br><font color="#888888">
<br>
        martin</font><div><div></div><div class="h5"><br>
<br>
<br>
<br>
On Tue, 21 Sep 2010, Vernon Everett wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Very elegant.<br>
And something new for me. I have never used the "bbcmd bbhostshow" command.<br>
It's a much better way of getting the complete contents of all the bb-hosts with includes.<br>
Every day is a schoolday. :-)<br>
<br>
I would suggest one or two improvements though.<br>
egrep '^[1-9][0-9]*\.' doesn't cater for my Wintel hosts which are defined with IP address 0.0.0.0<br>
We let Xymon use DNS for them, so I dropped the first [1-9].<br>
<br>
bb localhost "clientlog {} section=osversion" only works for Wintel.<br>
I changed it to the following<br>
bb localhost "clientlog {} section=osversion,uname"<br>
This will grab the relevant info for Wintel as well as Solaris.<br>
<br>
I then need to modify the output for Solaris, because the uname string includes the hostname.<br>
I eventually ended up with this.<br>
./server/bin/bbcmd bbhostshow | egrep '^[0-9]*\.' \<br>
                              | awk '{print $2}' \<br>
                              | sort -u \<br>
                              | xargs -I{} ./server/bin/bb localhost "clientlog {} section=osversion,uname" \<br>
                              | grep -v "^\[" \<br>
                              | awk ' $1 == "SunOS" { print $1" "$3" "$4}; $1 != "SunOS" {print} ' \<br>
                              | sort \<br>
                              | uniq -c<br>
<br>
That last awk might need to be seriously adapted for other OS types, or perhaps pipe the output to another similar awk.<br>
(Also, for SunOS, $4 is the patch level. Hack that to print $1" "$3 for OS version only)<br>
<br>
I ended up with output that looked like this<br>
  10 Microsoft  (build 7600)<br>
   2 Microsoft Windows Server 2003 R2, Standard Edition Service Pack 2 (build 3790)<br>
   6 Microsoft Windows Server 2008 , 64-bit Service Pack 2 (build 6002)<br>
   1 SunOS 5.10 Generic_139556-08<br>
   4 SunOS 5.10 Generic_141444-09<br>
  90 SunOS 5.10 Generic_142900-03<br>
Useful?<br>
I have no idea.<br>
<br>
And yes, I agree, temp files are bad. But unfortunately, a necessary evil sometimes.<br>
<br>
Cheers<br>
     Vernon<br>
<br>
<br>
On Tue, Sep 21, 2010 at 3:07 PM, David Baldwin <<a href="mailto:david.baldwin@ausport.gov.au" target="_blank">david.baldwin@ausport.gov.au</a>> wrote:<br>
      All you need is this 'one liner' for the count of each version:<br>
<br>
      bbcmd bbhostshow | egrep '^[1-9][0-9]*\.' | awk '{print $2}' | sort -u |<br>
      xargs -I{} bb localhost "clientlog {} section=osversion" | sort | uniq<br>
      -c | egrep -v '^[[:space:]]*[0-9]+( \[osversion\]|[[:space:]]*$)'<br>
<br>
      Look! No temporary files! (Pet hate of mine ;)<br>
<br>
      David.<br>
      > How does a wget call compare to using the bb command?<br>
      ><br>
      > I replaced the wget with:<br>
      >     $BBHOME/server/bin/bb localhost "clientlog $HOSTNAME<br>
      > section=osversion" | grep -v osversion > $HOSTNAME<br>
      ><br>
      > and the OSVER with:<br>
      >    OSVER=$(sed -e :a -e 's/<[^>]*>//g;/</N;//ba' $HOSTNAME)<br>
      ><br>
      ><br>
      ><br>
      > On Mon, Sep 20, 2010 at 9:33 AM, Vernon Everett<br>
> <<a href="mailto:everett.vernon@gmail.com" target="_blank">everett.vernon@gmail.com</a> <mailto:<a href="mailto:everett.vernon@gmail.com" target="_blank">everett.vernon@gmail.com</a>>> wrote:<br>
><br>
>     Bugger!<br>
>     Was pretty busy today, and completely forgot.<br>
><br>
>     Here's something that will help.<br>
>     #!/bin/ksh<br>
>     export BBHOME=/usr/lib/hobbit<br>
>     typeset -L20 HOST<br>
>     mkdir -p /usr/lib/hobbit/custom/data<br>
>     cd /usr/lib/hobbit/custom/data<br>
>     INCLUDES=$(grep ^include /etc/hobbit/bb-hosts | awk '{ print $2 }')<br>
>     cat /etc/hobbit/bb-hosts $INCLUDES | egrep -h -v<br>
>     "^#|^page|^$|^title|^subpage|^group|^include" | awk '{ print $2 }' \<br>
>        | sort | uniq \<br>
>        | while read HOSTNAME<br>
>          do<br>
>             wget -O $HOSTNAME -o /dev/null<br>
>     <a href="http://hobbit/hobbit-cgi/bb-hostsvc.sh%5C?HOST%5C=$HOSTNAME%5C&SERVICE%5C=info" target="_blank">http://hobbit/hobbit-cgi/bb-hostsvc.sh\?HOST\=$HOSTNAME\&SERVICE\=info</a><br>
>     <<a href="http://hobbit/hobbit-cgi/bb-hostsvc.sh%5C?HOST%5C=$HOSTNAME%5C&SERVICE%5C=info" target="_blank">http://hobbit/hobbit-cgi/bb-hostsvc.sh%5C?HOST%5C=$HOSTNAME%5C&SERVICE%5C=info</a>><br>
>     &<br>
>          done<br>
>     wait<br>
>     for HOSTNAME in /usr/lib/hobbit/custom/data/*<br>
>     do<br>
>        OSVER=$(grep OS: $HOSTNAME | sed 's/OS://g'| sed -e :a -e<br>
>     's/<[^>]*>//g;/</N;//ba')<br>
>        HOST=$(basename $HOSTNAME)<br>
>        echo "$HOST    $OSVER"<br>
>     done<br>
>     rm /usr/lib/hobbit/custom/data/*<br>
><br>
>     This will generate a list of hosts, and OS version.<br>
>     You want a list of number of OS versions, pipe the output to awk<br>
>     '{ print $2 }' | sort | uniq -c | awk '{ print $2":"$1}<br>
>     You can feed this back to Hobbit using bb, as a test and graph it.<br>
><br>
>     I recommend you use stack graphs for more interesting looking graphs.<br>
><br>
>     Let me know how you go.<br>
><br>
>     Regards<br>
>          Vernon<br>
><br>
><br>
><br>
><br>
>     On Mon, Sep 20, 2010 at 8:25 PM, Martin Flemming<br>
>     <<a href="mailto:martin.flemming@desy.de" target="_blank">martin.flemming@desy.de</a> <mailto:<a href="mailto:martin.flemming@desy.de" target="_blank">martin.flemming@desy.de</a>>> wrote:<br>
><br>
><br>
>             Got some code stubs I can post later when I get to work.<br>
><br>
><br>
>         That's will be great :-)<br>
><br>
>         thanks & cheers,<br>
><br>
>           martin<br>
><br>
><br>
>         On Mon, 20 Sep 2010, Vernon Everett wrote:<br>
><br>
>             Easy enough to knock together.<br>
>             Read it out of the server, then feed it back.<br>
><br>
>             Got some code stubs I can post later when I get to work.<br>
><br>
>             Cheers<br>
>                V<br>
><br>
><br>
>             On Sun, Sep 19, 2010 at 1:47 AM, Martin Flemming<br>
>             <<a href="mailto:martin.flemming@desy.de" target="_blank">martin.flemming@desy.de</a> <mailto:<a href="mailto:martin.flemming@desy.de" target="_blank">martin.flemming@desy.de</a>>><br>
>             wrote:<br>
><br>
>                  Hi !<br>
><br>
>                  Got somebody an working script for counting OS of<br>
>             alle clients<br>
>                  ( RHEl3/4/5 Solaris .5.8/5.19./5.10 etc ..) with<br>
>             graphing .. ?<br>
><br>
>                  I know some old threads about that request,<br>
>                  But hey didn't really work for me are without graphs<br>
>             .. :-(<br>
><br>
>                  thanks & cheers,<br>
><br>
><br>
>                        Martin<br>
><br>
><br>
>                  To unsubscribe from the xymon list, send an e-mail to<br>
>                  <a href="mailto:xymon-unsubscribe@xymon.com" target="_blank">xymon-unsubscribe@xymon.com</a><br>
>             <mailto:<a href="mailto:xymon-unsubscribe@xymon.com" target="_blank">xymon-unsubscribe@xymon.com</a>><br>
><br>
><br>
>         To unsubscribe from the xymon list, send an e-mail to<br>
>         <a href="mailto:xymon-unsubscribe@xymon.com" target="_blank">xymon-unsubscribe@xymon.com</a> <mailto:<a href="mailto:xymon-unsubscribe@xymon.com" target="_blank">xymon-unsubscribe@xymon.com</a>><br>
><br>
><br>
><br>
<br>
<br>
--<br>
David Baldwin - IT Unit<br>
Australian Sports Commission          <a href="http://www.ausport.gov.au" target="_blank">www.ausport.gov.au</a><br>
Tel 02 62147830 Fax 02 62141830       PO Box 176 Belconnen ACT 2616<br>
<a href="mailto:david.baldwin@ausport.gov.au" target="_blank">david.baldwin@ausport.gov.au</a>          Leverrier Street Bruce ACT 2617<br>
<br>
<br>
-------------------------------------------------------------------------------------<br>
Keep up to date with what's happening in Australian sport visit <a href="http://www.ausport.gov.au" target="_blank">http://www.ausport.gov.au</a><br>
<br>
This message is intended for the addressee named and may contain confidential and privileged information. If you are not the intended<br>
recipient please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited<br>
and may be unlawful. If you receive this message in error, please delete it and notify the sender.<br>
-------------------------------------------------------------------------------------<br>
<br>
To unsubscribe from the xymon list, send an e-mail to<br>
<a href="mailto:xymon-unsubscribe@xymon.com" target="_blank">xymon-unsubscribe@xymon.com</a><br>
<br>
<br>
</blockquote>
</div></div><br>To unsubscribe from the xymon list, send an e-mail to<br>
<a href="mailto:xymon-unsubscribe@xymon.com">xymon-unsubscribe@xymon.com</a><br>
<br></blockquote></div><br>