On Wed, May 25, 2005 at 02:58:18PM -0400, Tom Georgoulias wrote:
Is it possible to create some macros of hosts, then bundle combinations of those smaller macros into larger ones?
It's supposed to work, yes. And yes - there's a bug in how this is handled. You need the attached patch first.
Say I have 3 groups of systems:
$DB=%(db1|data1|dbase).domain.com
$MAIL=%(mail1|smtp|webmail).domain.com
$WS=%(ws1|fred|wilma).domain.com
I'd like to make 2 macros of those systems, one for critical systems, the other for everthing on my network:
$CRITICAL=%($DB|$MAIL)
$ALL=%($DB|$MAIL|$WS)
When doing this, remember that the macros are simple text-substitutions. So I'd leave out the "%" in the macros, because you end up with too many of them they way you have it. Instead, I'd do it like this:
$DB=(db1|data1|dbase).domain.com $MAIL=(mail1|smtp|webmail).domain.com $WS=(ws1|fred|wilma).domain.com
$CRITICAL=($DB|$MAIL) $ALL=($DB|$MAIL|$WS)
HOST=%$CRITICAL MAIL tom at domain.com
If in doubt, you can always run "hobbitd_alert --dump-config" to see what your configuration ends up with - it shows the configuration after expanding the macros.
Regards, Henrik