Doh!
I didn't realize I was doing things abnormally :)
My apologizes for the spam then.
--Pat
-----Original Message-----
From: user-ce4a2c883f75@xymon.invalid [mailto:user-ce4a2c883f75@xymon.invalid] Sent: Tuesday, May 23, 2006 4:50 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] Need for a report
On Tue, May 23, 2006 at 04:27:10PM -0400, user-c102b8958c7a@xymon.invalid 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