Xymon Mailing List Archive search

Removing many reports

2 messages in this thread

list Ulric Eriksson · Tue, 5 Sep 2006 08:07:34 +0200 (CEST) ·
I have figured out how to remove a single test from one host, or all tests from a single host. Is it possible to remove a single test from *all* hosts? Or all tests from all hosts? Or all tests that are purple?

I.e, are there Hobbit equivalents to these Big Brother tricks:

cd bbvar/logs

rm *.sometest

rm *

ls|xargs grep -l purple|xargs rm -f


Ulric
list Henrik Størner · Tue, 5 Sep 2006 09:26:23 +0200 ·
quoted from Ulric Eriksson
On Tue, Sep 05, 2006 at 08:07:34AM +0200, Ulric Eriksson wrote:
I have figured out how to remove a single test from one host, or 
all tests from a single host. 
The command
   bb 127.0.0.1 "hobbitdboard"
is your friend, combined with a bit of scripting. E.g:
Is it possible to remove a single test from *all* hosts? 
bb 127.0.0.1 "hobbitdboard test=MYTEST fields=hostname" |
   while read H; do bb 127.0.0.1 "drop $H MYTEST"; done
Or all tests from all hosts? 
bb 127.0.0.1 "hobbitdboard test=info fields=hostname" |
   while read H; do bb 127.0.0.1 "drop $H"; done
Or all tests that are purple?
bb 127.0.0.1 "hobbitdboard color=purple fields=hostname,testname" |
while read L; do 
      HOST=`echo $L | cut -d'|' -f1`
      TEST=`echo $L | cut -d'|' -f2`
      bb 127.0.0.1 "drop $HOST $TEST"
done


Regards,
Henrik