Xymon Mailing List Archive search

hobbitdboard arguments

4 messages in this thread

list Torsten Richter · Mon, 23 Apr 2007 13:38:41 +0200 ·
Hi fellows,

I've a question about the bb option hobbitdboard.
I am just converting a few scripts I've written for BB and I want of course incorporate the functionality that Hobbit has instead of digging through the log files.
What I'm trying to do is to get a list on which servers a certain test is running.
I do this by firing : ./bb 127.0.0.1 "hobbitdboard test=TEST"|awk -F\| '{print $1}' and get a list of all machines running TEST.
But not only thes machines but also the ones that are running test or myTEST or TestNEW which I don't want to be displayed.
So it seems that Hobbit is doing its search case insensitive.
Is there a switch for this and for search only tests that match the whole word instead of a substring?
Or do I have to replace the above statement with:
./bb 127.0.0.1 "hobbitdboard test=TEST"|grep -w "TEST|awk -F\| '{print $1}'

Regards
Torsten
list Dominique Frise · Mon, 23 Apr 2007 13:47:00 +0200 ·
quoted from Torsten Richter
Torsten Richter wrote:
Hi fellows,

I've a question about the bb option hobbitdboard.
I am just converting a few scripts I've written for BB and I want of course incorporate the functionality that Hobbit has instead of digging through the log files.
What I'm trying to do is to get a list on which servers a certain test is running.
I do this by firing : ./bb 127.0.0.1 "hobbitdboard test=TEST"|awk -F\| '{print $1}' and get a list of all machines running TEST.
But not only thes machines but also the ones that are running test or myTEST or TestNEW which I don't want to be displayed.
So it seems that Hobbit is doing its search case insensitive.
Is there a switch for this and for search only tests that match the whole word instead of a substring?
./bb 127.0.0.1 "hobbitdboard test=^myTEST$ |awk -F\| '{print $1}'


Dominique
UNIL - University of Lausanne
list Henrik Størner · Mon, 23 Apr 2007 13:52:32 +0200 ·
quoted from Torsten Richter
On Mon, Apr 23, 2007 at 01:38:41PM +0200, Torsten Richter wrote:
What I'm trying to do is to get a list on which servers a certain test is running.
I do this by firing : ./bb 127.0.0.1 "hobbitdboard test=TEST"|awk -F\| '{print $1}' 
and get a list of all machines running TEST.
But not only thes machines but also the ones that are running test or myTEST or 
TestNEW which I don't want to be displayed.
The "test=..." is used as a regular expression. So to get only those
that have the exact TEST status, use

 ./bb 127.0.0.1 'hobbitdboard test=(?-i)^TEST$ fields=hostname'

The "(?-i)" makes the match case-sensitive, and the "^...$" anchors it.


Regards,
Henrik
list S Aiello · Mon, 23 Apr 2007 07:53:53 -0400 ·
quoted from Torsten Richter
Torsten Richter wrote:
Hi fellows,

I've a question about the bb option hobbitdboard.
I am just converting a few scripts I've written for BB and I want of
course incorporate the functionality that Hobbit has instead of digging
through the log files. What I'm trying to do is to get a list on which
servers a certain test is running. I do this by firing : ./bb 127.0.0.1
"hobbitdboard test=TEST"|awk -F\| '{print $1}' and get a list of all
machines running TEST. But not only thes machines but also the ones that
are running test or myTEST or TestNEW which I don't want to be displayed.
So it seems that Hobbit is doing its search case insensitive.
Is there a switch for this and for search only tests that match the whole
word instead of a substring?
./bb 127.0.0.1 "hobbitdboard test=^myTEST$ |awk -F\| '{print $1}'
Also, you don't need to use awk to filter on certain fields, you can just use 
the hobbitdboard fields= option.

./bb 127.0.0.1 "hobbitdboard test=^myTEST$ fields=hostname,testname"

~Steve