[hobbit] Need for a report

Henrik Stoerner henrik at hswn.dk
Tue May 23 22:49:46 CEST 2006


On Tue, May 23, 2006 at 04:27:10PM -0400, PNIXON at ci.somerville.ma.us wrote:
> Cleaned up the formatting and changed from grep -h red to grep -l "^red"
> 
> --
> #!/bin/sh
> BBVAR="/bb/bbvar"
> 
> TOTAL=`ls $BBVAR/logs/*.conn | wc -l`
> red=`grep -l "^red" $BBVAR/logs/*.conn | wc -l` 
> yellow=`grep -l "^yellow" $BBVAR/logs/*.conn | wc -l` 
> clear=`grep -l "^clear" $BBVAR/logs/*.conn | wc -l` 
> blue=`grep -l "^blue" $BBVAR/logs/*.conn | wc -l` 
> purple=`grep -l "^purple" $BBVAR/logs/*.conn | wc -l`
> 
> echo "Total Connectivity: $TOTAL
> Red Conn: $red
> Yellow Conn: $yellow
> Clear Conn: $clear
> Disabled Conn: $blue
> Purple Conn: $purple"

This works fine for a BB installation, but not for Hobbit since
Hobbit doesn't store the logfiles on disk (not in the default
configuration, at least).

So as Francesco mentioned, you should fetch the status with the
hobbitdboard command. Something like this would do it:

  bb 127.0.0.1 "hobbitdboard color=red,yellow,purple,green test=conn fields=color" | sort | uniq -c

On one of my systems this yields:

   1416 green
     68 purple
    143 red

Sounds like what the original poster wanted.


Regards,
Henrik




More information about the Xymon mailing list