[hobbit] Host Groups in hobbit-alerts.cfg as per BB?
That's the documented way of doing it, yes. Although your example is not quite correct - it should be "%(hostA1|hostA2|hostB3|otherhost)".
The simple way is this: "hostA1,hostA2,hostB3,otherhost"
Note: You cannot mix the two - it's either a regular expression, or a simple list.
I'm trying to migrate from a large BB installation which made extensive use of host groups via the BBConfigure script. While some of the groups would allow for a regex to describe its members, there are quite a few sizable groups where this isn't feasible.
Is there any way hobbit could support the bbwarnsetup.cfg file style of host groups? Or possibly the HOST (and MAIL arguments for that matter) could accept shell commands somehow?
For example:
HOST=/usr/local/bin/bbgroup netapps
MAIL cat oncall.txt
(And bbgroup would assemple a comma seperated list of netapp hosts.)
Though I suppose the SCRIPT keyword would allow something similar for mailing.
Thoughts?
-- Bruce Z. Lysik <blysik at shutterfly.com> Operations Engineer
On Wed, Jan 26, 2005 at 03:28:40PM -0800, Bruce Lysik wrote:
I'm trying to migrate from a large BB installation which made extensive use of host groups via the BBConfigure script. While some of the groups would allow for a regex to describe its members, there are quite a few sizable groups where this isn't feasible.
I doubt that. PCRE's are extremely flexible, see below.
Is there any way hobbit could support the bbwarnsetup.cfg file style of host groups?
No. Frankly, I think this would be unnecessary bloat, because it is fairly easy to do a script that converts the bbwarnsetup hostgroup definitions into Hobbit macros that can be used directly in the alert definitions.
I've attached such a script - it appears to work on the bbwarnsetup.cfg I have, but there might be some special cases with bbwarnsetup features I dont use.
E.g. if you have a definition like this one
hg-asd: mwsicha* asp* mwscsg* slsportal* asdad* asdnam* asdmgmt*
the script outputs a macro definition:
$HG-ASD=mwsicha(.*)|asp(.*)|mwscsg(.*)|slsportal(.*)|asdad(.*)|asdnam(.*)|asdmgmt(.*)
Put this in your hobbit-alerts.cfg, and you can define rules like this:
HOST=%$HG-ASD MAIL admin at foo.com SERVICE=http
etc.
(I admit - it's untested, but it should definitely work. The expression at least is correct, and matches the hostnames it is supposed to match).
Henrik
participants (2)
-
blysik@shutterfly.com
-
henrik@hswn.dk