Xymon Mailing List Archive search

Comma-separated lists of hostnames, etc. in hobbit-alerts.cfg is not documented

11 messages in this thread

list Sebastian Auriol · Wed, 15 Oct 2008 13:43:35 +0100 ·
Comma-separated lists of hostnames in hobbit-alerts.cfg is not documented,
so maybe we could add something like this (taken from
http://hobbitmon.sourceforge.net/docs/man5/hobbit-clients.cfg.5.html) to
http://hobbitmon.sourceforge.net/docs/man5/hobbit-alerts.cfg.5.html:

        HOST=targetstring Rule matching a host by the hostname.
"targetstring"
        is either a comma-separated list of hostnames (from the bb-hosts
file),
        "*"  to  indicate "all hosts", or a Perl-compatible regular
expression.
        E.g.  "HOST=dns.foo.com,www.foo.com"  identifies  two  specific
hosts;
        "HOST=%www.*.foo.com  EXHOST=www-test.foo.com" matches all hosts
with a
        name beginning with "www", except the "www-test" host.

Adding an example that used the comma-separated syntax to
http://hobbitmon.sourceforge.net/docs/hobbit-alerts.html and
hobbit-alerts.cfg (sample) files would also be good.

And, actually, maybe something to say that the comma-separated syntax can be
used in all XXX= places (except, presumably, REPEAT) and also for the
recipient.  One really shouldn't have to work this basic stuff out using:
$ ./bin/bbcmd hobbitd_alert --test
!
We definitely need some more complex examples.  Maybe someone who has a
complex and varied hobbit-alerts.cfg can post some sanitized examples that
someone can commit to SVN?

Many thanks,

SebA
list Jm54601 · Wed, 15 Oct 2008 08:03:01 -0700 (PDT) ·
I struggled with the same thing through a lot of trial and error.  On a related note, I highly recommend trying to get away from using a comma separated list as it's a nightmare to maintain.  I'm working toward using the PAGE token, where a list of hosts on a given page alerts a group, so you're effectively grouping your hosts based on the support team responsible.  There will still be exceptions, but if you can generalize alerts so all the hosts on a given page can alert the same way, you'll save time and avoid the possibility of a host not having an alert configured.  Just my 2 cents.
quoted from Sebastian Auriol


 


----- Original Message ----
From: SebA <user-7b2156f36779@xymon.invalid>
To: user-ae9b8668bcde@xymon.invalid
Sent: Wednesday, October 15, 2008 7:43:35 AM
Subject: [hobbit] Comma-separated lists of hostnames, etc. in hobbit-alerts.cfg is not documented


Comma-separated lists of hostnames in hobbit-alerts.cfg is not documented, so maybe we could add something like this (taken from  http://hobbitmon.sourceforge.net/docs/man5/hobbit-clients.cfg.5.html) to http://hobbitmon.sourceforge.net/docs/man5/hobbit-alerts.cfg.5.html:
        HOST=targetstring Rule matching a host by the hostname.  "targetstring"
        is either a comma-separated list of hostnames (from the bb-hosts file),
        "*"  to  indicate "all hosts", or a Perl-compatible regular expression.
        E.g.  "HOST=dns.foo.com,www.foo.com"  identifies  two  specific  hosts;
        "HOST=%www.*.foo.com  EXHOST=www-test.foo.com" matches all hosts with a
        name beginning with "www", except the "www-test" host. 

Adding an example that used the comma-separated syntax to http://hobbitmon.sourceforge.net/docs/hobbit-alerts.htmland hobbit-alerts.cfg (sample) files would also be good.
quoted from Sebastian Auriol
And, actually, maybe something to say that the comma-separated syntax can be used in all XXX= places (except, presumably, REPEAT) and also for the recipient.  One really shouldn't have to work this basic stuff out using:
$ ./bin/bbcmd hobbitd_alert --test 
! 
We definitely need some more complex examples.  Maybe someone who has a complex and varied hobbit-alerts.cfg can post some sanitized examples that someone can commit to SVN?
Many thanks, 
SebA
list Sebastian Auriol · Wed, 15 Oct 2008 16:25:16 +0100 ·
Thanks for the suggestion.  I'll certainly give that some thought.
Comma-separated is just the easiest when it comes to converting my existing
bbwarnrules.cfg file as I can just select the hosts and replace spaces with
commas.  Going forward I had thought of using macros, but I'll look at PAGEs
too.
 
SebA
quoted from Jm54601


From: user-747f2264746a@xymon.invalid [mailto:user-747f2264746a@xymon.invalid] 
Sent: 15 October 2008 16:03
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] Comma-separated lists of hostnames, etc. in
hobbit-alerts.cfg is not documented


I struggled with the same thing through a lot of trial and error.  On a
related note, I highly recommend trying to get away from using a comma
separated list as it's a nightmare to maintain.  I'm working toward using
the PAGE token, where a list of hosts on a given page alerts a group, so
you're effectively grouping your hosts based on the support team
responsible.  There will still be exceptions, but if you can generalize
alerts so all the hosts on a given page can alert the same way, you'll save
time and avoid the possibility of a host not having an alert configured.
Just my 2 cents.
 

----- Original Message ----
From: SebA <user-7b2156f36779@xymon.invalid>
To: user-ae9b8668bcde@xymon.invalid
Sent: Wednesday, October 15, 2008 7:43:35 AM
Subject: [hobbit] Comma-separated lists of hostnames, etc. in
hobbit-alerts.cfg is not documented


Comma-separated lists of hostnames in hobbit-alerts.cfg is not documented,
so maybe we could add something like this (taken from
<http://hobbitmon.sourceforge.net/docs/man5/hobbit-clients.cfg.5.html>;

http://hobbitmon.sourceforge.net/docs/man5/hobbit-clients.cfg.5.html) to
<http://hobbitmon.sourceforge.net/docs/man5/hobbit-alerts.cfg.5.html>;
quoted from Jm54601
http://hobbitmon.sourceforge.net/docs/man5/hobbit-alerts.cfg.5.html:

        HOST=targetstring Rule matching a host by the hostname.
"targetstring"
        is either a comma-separated list of hostnames (from the bb-hosts
file),
        "*"  to  indicate "all hosts", or a Perl-compatible regular
expression.

        E.g.  "HOST=dns.foo.com, <http://www.foo.com/>; www.foo.com"
identifies  two  specific  hosts;
        "HOST=%www.*.foo.com <http://foo.com/>;   EXHOST=www-test.foo.com"
quoted from Jm54601
matches all hosts with a
        name beginning with "www", except the "www-test" host. 

Adding an example that used the comma-separated syntax to
<http://hobbitmon.sourceforge.net/docs/hobbit-alerts.html>;
http://hobbitmon.sourceforge.net/docs/hobbit-alerts.html and
hobbit-alerts.cfg (sample) files would also be good.

And, actually, maybe something to say that the comma-separated syntax can be
used in all XXX= places (except, presumably, REPEAT) and also for the
recipient.  One really shouldn't have to work this basic stuff out using:

$ ./bin/bbcmd hobbitd_alert --test 
! 
We definitely need some more complex examples.  Maybe someone who has a
complex and varied hobbit-alerts.cfg can post some sanitized examples that
someone can commit to SVN?

Many thanks, 

SebA
list T.J. Yang · Wed, 15 Oct 2008 10:43:54 -0500 ·
Hi, SebA

Would mind go one step further ?
get  a hobbit developer account  from Henrik to update the manpages ?

T.J. Yang
quoted from Sebastian Auriol

From: user-7b2156f36779@xymon.invalid
To: user-ae9b8668bcde@xymon.invalid
Date: Wed, 15 Oct 2008 16:25:16 +0100
Subject: RE: [hobbit] Comma-separated lists of hostnames, etc. in hobbit-alerts.cfg is not documented


Thanks for the suggestion.  I'll certainly give that some thought.  Comma-separated is just the easiest when it comes to converting my existing bbwarnrules.cfg file as I can just select the hosts and replace spaces with commas.  Going forward I had thought of using macros, but I'll look at PAGEs too.
 SebA


      From: user-747f2264746a@xymon.invalid   [mailto:user-747f2264746a@xymon.invalid] Sent: 15 October 2008   16:03
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit]   Comma-separated lists of hostnames, etc. in hobbit-alerts.cfg is not   documented


      I struggled with the same thing through a lot of trial and error.    On a related note, I highly recommend trying to get away from using a comma   separated list as it's a nightmare to maintain.  I'm working toward using   the PAGE token, where a list of hosts on a given page alerts a group, so   you're effectively grouping your hosts based on the support team   responsible.  There will still be exceptions, but if you can generalize   alerts so all the hosts on a given page can alert the same way, you'll save   time and avoid the possibility of a host not having an alert configured.    Just my 2 cents.
        
  -----   Original Message ----
From: SebA <user-7b2156f36779@xymon.invalid>
To:   user-ae9b8668bcde@xymon.invalid
Sent: Wednesday, October 15, 2008 7:43:35 AM
Subject:   [hobbit] Comma-separated lists of hostnames, etc. in hobbit-alerts.cfg is not   documented


  Comma-separated lists of hostnames in   hobbit-alerts.cfg is not documented, so maybe we could add something like this   (taken from  http://hobbitmon.sourceforge.net/docs/man5/hobbit-clients.cfg.5.html) to http://hobbitmon.sourceforge.net/docs/man5/hobbit-alerts.cfg.5.html:
            HOST=targetstring Rule matching a host by the hostname.    "targetstring"
        is either a   comma-separated list of hostnames (from the bb-hosts   file),
        "*"  to    indicate "all hosts", or a Perl-compatible regular   expression.
        E.g.    "HOST=dns.foo.com,www.foo.com"    identifies  two  specific    hosts;
        "HOST=%www.*.foo.com    EXHOST=www-test.foo.com" matches all hosts with   a
        name beginning with "www",   except the "www-test" host.   Adding an example that used the comma-separated   syntax to http://hobbitmon.sourceforge.net/docs/hobbit-alerts.html and hobbit-alerts.cfg (sample) files would also be   good.
  And, actually, maybe something to say that the   comma-separated syntax can be used in all XXX= places (except, presumably,   REPEAT) and also for the recipient.  One really shouldn't have to work   this basic stuff out using:
  $ ./bin/bbcmd hobbitd_alert --test ! We definitely need some more   complex examples.  Maybe someone who has a complex and varied   hobbit-alerts.cfg can post some sanitized examples that someone can commit to   SVN?
  Many thanks,   SebA 


Want to do more with Windows Live? Learn “10 hidden secrets” from Jamie.
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008
list Jm54601 · Wed, 15 Oct 2008 09:04:15 -0700 (PDT) ·
Here's a script I used to convert bbwarnrules.cfg to hobbit-alerts.cfg.  It's far from perfect, but might help you save some labor.  We also used host groups and page groups fairly extensively in bbwarnsetup.cfg.  This script merges both.

#!/bin/bash
# Converts bbwarnrules.cfg to hobbit-alerts.cfg format
# TO DO: DAY and TIME
#BBWR=/usr/local/bb/etc/bbwarnrules.cfg
#BBWS=/usr/local/bb/etc/bbwarnsetup.cfg
BBWR=bbwarnrules.cfg
BBWS=bbwarnsetup.cfg
OUT1=/tmp/HGA.`date +%s`
HG='hg-'
DHG='$hg-'
PG='pg-'
DPG='$pg-'
#for i in `grep ^hg- $BBWR|tr ' ' '+'`
for i in `cat $BBWR | tr ' ' '+'`
do
if [[ $i == [h][g]* ]]
then
# HOST=`echo $i | tr '+' ' ' | awk -F\; '{print $1}'| sed -e s/$HG/$DHG/g`
HGA=`echo $i | awk -F\; '{print $1}'`
if [[ $HGA == *[+]* ]]
then
# echo handle multiple hostgroups
echo -n HOST=
for yy in `echo $HGA | tr '+' ' '`
do
grep -w $yy $BBWS|awk -F: '{print $2}' >> $OUT1
done
for xx in `cat $OUT1`
do
echo -n $xx,
done | sed s/.$//
rm $OUT1
else
grep -w $HGA $BBWS | awk -F: '{print $2}' | tr ' ' ',' | sed -e s/,/HOST=/
fi
EXHOST=`echo $i | tr '+' ' ' | awk -F\; '{print $2}'| sed -e s/$HG/$DHG/g`
# SERVICE=`echo $i | tr '+' ',' | tr '*' 'x' | awk -F\; '{print $3}' | sed -e s/fping/conn/g`
SERVICE=`echo $i | tr '+' ',' | awk -F\; '{print $3}' | sed -e s/fping/conn/g`
EXSERVICE=`echo $i | tr '+' ',' | awk -F\; '{print $4}'`
DAY=`echo $i | tr '+' ',' | awk -F\; '{print $5}'`
TIME=`echo $i | tr '+' ',' | awk -F\; '{print $6}'`
MAIL=`echo $i | tr '+' ' ' | awk -F\; '{print $7}'`
if [[ $EXHOST != "" ]]
then
echo -n " EXHOST=%$EXHOST"
fi
echo -n " SERVICE=$SERVICE"
if [[ $EXSERVICE != "" ]]
then
echo -n " EXSERVICE=$EXSERVICE"
fi
if [[ $DAY == \* && $TIME == \* ]]
then
true
else
echo -n " TIME=$DAY:$TIME" | tr '-' ':'
fi
echo " RECOVERED"
for m in $MAIL
do
case $m in
ext*)
SCR=`echo " SCRIPT /usr/local/hobbit/server/ext/pg/$m REMEDY" | sed -e s/ext-//g | sed -e s/-tokin//g | sed -e s/\:\~/+DURATION\>/g | tr '+' ' '`
echo -n " "
echo $SCR | awk '{print $1" "$2" "$4" "$3}'
;;
pg-*)
echo " MAIL $m" | sed -e s/$PG/$DPG/g | sed -e s/\:\~/+DURATION\>/g | tr '+' ' '
;;
*)
echo " MAIL $m" | sed -e s/\:\~/+DURATION\>/g | tr '+' ' '
;;
esac
done
echo
elif [[ $i != \#* && $i != \*DC* && $i != notify* && $i != \* && $i != unmatched* && $i != \!* ]]
then
HOST=`echo $i | tr '+' ' ' | awk -F\; '{print $1}'`
EXHOST=`echo $i | tr '+' ' ' | awk -F\; '{print $2}'`
SERVICE=`echo $i | tr '+' ',' | awk -F\; '{print $3}' | sed -e s/fping/conn/g`
EXSERVICE=`echo $i | tr '+' ',' | awk -F\; '{print $4}'`
MAIL=`echo $i | tr '+' ' ' | awk -F\; '{print $7}'`
echo -n "HOST=$HOST" | tr ' ' ','
if [[ $EXHOST != "" ]]
then
echo -n " EXHOST=$EXHOST"
fi
echo -n " SERVICE=$SERVICE"
if [[ $EXSERVICE != "" ]]
then
echo -n " EXSERVICE=$EXSERVICE"
fi
if [[ $DAY == \* && $TIME == \* ]]
then
true
else
echo -n " TIME=$DAY:$TIME" | tr '-' ':'
fi
echo " RECOVERED"
for m in $MAIL
do
case $m in
ext*)
#echo " SCRIPT /usr/local/hobbit/server/ext/pg/$m REMEDY"| sed -e s/ext-//g | sed -e s/-tokin//g | sed -e s/\:\~/+DURATION\>/g | tr '+' ' '
SCR=`echo "SCRIPT /usr/local/hobbit/server/ext/pg/$m REMEDY" | sed -e s/ext-//g | sed -e s/-tokin//g | sed -e s/\:\~/+DURATION\>/g | tr '+' ' '`
echo -n " "
echo $SCR| awk '{print $1" "$2" "$4" "$3}'
;;
pg-*)
echo " MAIL $m" | sed -e s/$PG/$DPG/g | sed -e s/\:\~/+DURATION\>/g | tr '+' ' '
;;
*)
echo " MAIL $m" | sed -e s/\:\~/+DURATION\>/g | tr '+' ' '
;;
esac
done
echo
elif [[ $i == \#* ]]
then
echo $i | tr '+' ' '
else
echo -n '#FIX THIS#'
echo $i | tr '+' ' '
fi
done
quoted from T.J. Yang


 


From: user-7b2156f36779@xymon.invalid
To: user-ae9b8668bcde@xymon.invalid
Date: Wed, 15 Oct 2008 16:25:16 +0100
Subject: RE: [hobbit] Comma-separated lists of hostnames, etc. in hobbit-alerts.cfg is not documented


Thanks for the suggestion.  I'll certainly give that some thought.  Comma-separated is just the easiest when it comes to converting my existing bbwarnrules.cfg file as I can just select the hosts and replace spaces with commas.  Going forward I had thought of using macros, but I'll look at PAGEs too.
 
SebA


From: user-747f2264746a@xymon.invalid [mailto:user-747f2264746a@xymon.invalid] 
Sent: 15 October 2008 16:03
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] Comma-separated lists of hostnames, etc. in hobbit-alerts.cfg is not documented


I struggled with the same thing through a lot of trial and error.  On a related note, I highly recommend trying to get away from using a comma separated list as it's a nightmare to maintain.  I'm working toward using the PAGE token, where a list of hosts on a given page alerts a group, so you're effectively grouping your hosts based on the support team responsible.  There will still be exceptions, but if you can generalize alerts so all the hosts on a given page can alert the same way, you'll save time and avoid the possibility of a host not having an alert configured.  Just my 2 cents.


 


----- Original Message ----
From: SebA <user-7b2156f36779@xymon.invalid>
To: user-ae9b8668bcde@xymon.invalid
Sent: Wednesday, October 15, 2008 7:43:35 AM
Subject: [hobbit] Comma-separated lists of hostnames, etc. in hobbit-alerts.cfg is not documented

Comma-separated lists of hostnames in hobbit-alerts.cfg is not documented, so maybe we could add something like this (taken from  http://hobbitmon.sourceforge.net/docs/man5/hobbit-clients.cfg.5.html) to http://hobbitmon.sourceforge.net/docs/man5/hobbit-alerts.cfg.5.html:
        HOST=targetstring Rule matching a host by the hostname.  "targetstring"
        is either a comma-separated list of hostnames (from the bb-hosts file),
        "*"  to  indicate "all hosts", or a Perl-compatible regular expression.
        E.g.  "HOST=dns.foo.com,www.foo.com"  identifies  two  specific  hosts;
        "HOST=%www.*.foo.com  EXHOST=www-test.foo.com" matches all hosts with a
        name beginning with "www", except the "www-test" host. 
Adding an example that used the comma-separated syntax to http://hobbitmon.sourceforge.net/docs/hobbit-alerts.htmland hobbit-alerts.cfg (sample) files would also be good.
And, actually, maybe something to say that the comma-separated syntax can be used in all XXX= places (except, presumably, REPEAT) and also for the recipient.  One really shouldn't have to work this basic stuff out using:
$ ./bin/bbcmd hobbitd_alert --test 
! 
We definitely need some more complex examples.  Maybe someone who has a complex and varied hobbit-alerts.cfg can post some sanitized examples that someone can commit to SVN?
Many thanks, 
SebA 


Want to do more with Windows Live? Learn “10 hidden secrets” from Jamie. Learn Now
list Shawn Heisey · Wed, 15 Oct 2008 10:37:21 -0600 ·
quoted from Jm54601
I struggled with the same thing through a lot of trial and error.  On a related note, I highly recommend trying to get away from using a comma separated list as it's a nightmare to maintain.  I'm working toward using the PAGE token, where a list of hosts on a given page alerts a group, so you're effectively grouping your hosts based on the support team responsible.  There will still be exceptions, but if you can generalize alerts so all the hosts on a given page can alert the same way, you'll save time and avoid the possibility of a host not having an alert configured.  Just my 2 cents.
<snip>
We definitely need some more complex examples.  Maybe someone who has a complex and varied hobbit-alerts.cfg can post some sanitized examples that someone can commit to SVN?

Many thanks,

SebA

I use regular expressions and the macro capability to create a situation similar to the host groups and page groups from Big Brother, but more powerful.  This results in a hobbit-alerts.cfg file that is considerably smaller than it might have been, and makes changes easier. At the end of this message are some excerpts with the domain name obscured:

I found that I couldn't effectively use the PAGE capability.  I started to set it up, but found that I was only putting one or two hosts on many of the pages.  This made it very cumbersome to find anything, so everything is on one page.  I've set up the webserver so that entering "hobbit" into a browser lands you on the non-green list.  Because we've got a lot of hosts on that single page and we're nowhere near done adding things, I might go back and divide things up into multiple pages, but it won't be used for alerting.

Statistics:
 Hosts               :   131
 Status messages     :  1159
 Purple messages     :     0
 Pages               :     1

$HG_BSESSION=%(bs07|bs08|mn01bs1|mn01bs1|dvb[0-9]bs[0-9])
$HG_MFTP=%(ftpman[0-9]*|mediasftp[0-9]*|feedpro[0-9]*)
$PG_MFTP=user-d157b1fa169f@xymon.invalid,user-c67864fdccfd@xymon.invalid
$PG_MEDIAS=user-e1c0060939f2@xymon.invalid
$PG_NOC=user-0a022e65d79d@xymon.invalid,user-d3c8dc9e0d8b@xymon.invalid,user-b5db66054085@xymon.invalid
$PG_IT=user-d3c8dc9e0d8b@xymon.invalid

#--
HOST=$HG_BSESSION EXSERVICE=msgs
   MAIL $PG_MEDIAS,$PG_NOC REPEAT=30 COLOR=red,purple RECOVERED

HOST=$HG_BSESSION SERVICE=msgs
   MAIL $PG_MEDIAS,$PG_IT REPEAT=30 COLOR=red,purple

#--
HOST=$HG_MFTP EXSERVICE=msgs
   MAIL $PG_MFTP,$PG_NOC REPEAT=30 COLOR=red,purple RECOVERED

HOST=$HG_MFTP SERVICE=msgs
   MAIL $PG_MFTP,$PG_IT REPEAT=30 COLOR=red,purple

#
# Catchall entries using the UNMATCHED mail target
#

HOST=* EXSERVICE=msgs
   MAIL $PG_NOC REPEAT=30 COLOR=red,purple RECOVERED UNMATCHED

HOST=* SERVICE=msgs
   MAIL $PG_IT REPEAT=30 COLOR=red,purple UNMATCHED
list Buchan Milne · Thu, 16 Oct 2008 09:59:10 +0200 ·
quoted from T.J. Yang
On Wednesday 15 October 2008 17:43:54 T.J. Yang wrote:
Hi, SebA

Would mind go one step further ?
get  a hobbit developer account  from Henrik to update the manpages ?

In other projects I am familiar with, initial contributions start with patches filed on a tracker. Commit access is *not* necessary for contribution, but an RCS (which we now have) and interaction with people who do have commit access is.

(I haven't asked for commit access as I think my own contributions would need to follow such a path).

Regards,
Buchan
list Sebastian Auriol · Mon, 3 Nov 2008 21:45:20 -0000 ·
Thanks very much for this!  It will certainly save me some time.  One issue
I've noticed is that the EXHOST's remain space separated and not comma
separated.  No big deal as I can fix that from the output, or the following
minor patch appears to fix it:
 
--- convert_bbwarnrules_to_hobbit-alerts.sh     2008-11-03
20:59:28.000000000 +0000
+++ convert_bbwarnrules_to_hobbit-alerts_v1.1.sh        2008-11-03
22:31:34.000000000 +0000
@@ -76,7 +76,7 @@
quoted from Jm54601
 elif [[ $i != \#* && $i != \*DC* && $i != notify* && $i != \* && $i !=
unmatched* && $i != \!* ]]
 then
 HOST=`echo $i | tr '+' ' ' | awk -F\; '{print $1}'`
-EXHOST=`echo $i | tr '+' ' ' | awk -F\; '{print $2}'`
+EXHOST=`echo $i | tr '+' ',' | awk -F\; '{print $2}'`
 SERVICE=`echo $i | tr '+' ',' | awk -F\; '{print $3}' | sed -e
s/fping/conn/g`
 EXSERVICE=`echo $i | tr '+' ',' | awk -F\; '{print $4}'`
 MAIL=`echo $i | tr '+' ' ' | awk -F\; '{print $7}'`

Does that seem right?  The code's a bit hard to follow for me without
indentation and stuff.  It looks like all spaces are changed to + at the
beginning.

Blank lines get replaced with:
 SERVICE= TIME=: RECOVERED
But again, that's no big deal. I can easily strip those lines out.
quoted from Jm54601
 
SebA 


	From: user-747f2264746a@xymon.invalid [mailto:user-747f2264746a@xymon.invalid] 
	Sent: 15 October 2008 17:04
	To: user-ae9b8668bcde@xymon.invalid
	Subject: Re: [hobbit] Comma-separated lists of hostnames, etc. in
hobbit-alerts.cfg is not documented
	
	
	Here's a script I used to convert bbwarnrules.cfg to
hobbit-alerts.cfg.  It's far from perfect, but might help you save some
labor.  We also used host groups and page groups fairly extensively in
bbwarnsetup.cfg.  This script merges both.
	 

	<snip: refer to
http://www.hobbitmon.com/hobbiton/2008/10/msg00257.html>;
list Sebastian Auriol · Wed, 3 Dec 2008 19:19:50 -0000 ·
quoted from Shawn Heisey
Shawn Heisey <mailto:user-5d0d01dba542@xymon.invalid> wrote:
I use regular expressions and the macro capability to create
a situation
similar to the host groups and page groups from Big Brother, but more
powerful.  This results in a hobbit-alerts.cfg file that is
considerably smaller than it might have been, and makes changes
easier. At 
the end of
this message are some excerpts with the domain name obscured:
<snip>

Many thanks for your examples!

SebA
list Sebastian Auriol · Wed, 3 Dec 2008 19:20:56 -0000 ·
quoted from Buchan Milne
Buchan Milne <mailto:user-9b139aff4dec@xymon.invalid> wrote:
On Wednesday 15 October 2008 17:43:54 T.J. Yang wrote:
Hi, SebA

Would mind go one step further ?
get  a hobbit developer account  from Henrik to update the manpages ?

In other projects I am familiar with, initial contributions start
with patches filed on a tracker. Commit access is *not* necessary for
contribution, but an RCS (which we now have) and interaction with
people who do have commit access is.

(I haven't asked for commit access as I think my own contributions
would need to follow such a path).

Regards,
Buchan
While I'm flattered by your suggestion TJ, I do agree with Buchan.
Especially as I have no proven ability to patch man pages. In fact, I don't
know what the syntax is for them, and while I'm sure I could learn pretty
easily, I'm really too busy in my work to justify this right now. And,
anyway, I was trying to encourage someone who had or knew some more complex
examples to submit them first.

And, on that subject, I was _going_ to ask if it was possible to do this:
HOST=myHost
     MAIL myEmail SERVICE=procs,smtp ...
Since that isn't documented either: all the examples have SERVICE on the
same line as HOST. Well, I decided I'd test it myself with:
$ ./bin/bbcmd hobbitd_alert --test
And the answer is yes so long as you put the SERVICE= after the MAIL
command.

(If the SERVICE= is before the MAIL command, as in:
HOST=myHost
     SERVICE=procs,smtp MAIL myEmail ...
then it is as if you had:
HOST=myHost # Becomes irrelevant as the parser reckons the next line is
another completely separate rule.
SERVICE=procs,smtp
     MAIL myEmail ...
Which is unlikely to be what you intended.)

Maybe we have now covered all the examples needed though?

Kind regards,

SebA
list Sebastian Auriol · Wed, 3 Dec 2008 20:14:20 -0000 ·
SebA <mailto:user-7b2156f36779@xymon.invalid> wrote:
Maybe we have now covered all the examples needed though?
Ah, a few more examples I've been playing with FYI and for the
documentation:
HOST=%myhost(.*) EXHOST=myhost.whatever ... (whatever else)
Works. You _can_ use HOST and EXHOST together. (Docs don't mention this.)

Or you can do it like this:
HOST=%myhost(.*) SERVICE=conn,http,imap,pop3,smtp
     MAIL CommaSeparatedE-MailAddresses EXHOST=myhost.whatever
EXHOST even works in the MAIL line(s).

Nice.

And you can even have nested HOST flags, e.g.:
HOST=%myhost(.*) SERVICE=conn,http,imap,pop3,smtp
     MAIL CommaSeparatedE-MailAddresses HOST=myhost.whatever

Very nice for having different DURATIONs depending on the interface of
myhost that is being network tested. :)

Oh, BTW, I also discovered you can add durations and colors and things to
the hobbitd_alert --test: 
./bin/bbcmd hobbitd_alert --test myhost smtp --duration=11
And similar. This is documented here:
http://hobbitmon.sourceforge.net/docs/man8/hobbitd_alert.8.html but it would
be easier to find that man page if there was a link from
http://hobbitmon.sourceforge.net/docs/hobbit-alerts.html ;)

Kind regards,

SebA	

Better documentation => more user-friendly, less frustration => more Xymon
users... ;)