On-demand macros are a great thing, and the check_cluster2 plug-in is a
great way to use them. Unfortunately, if you want to use more than a few
on-demand macros on a single line, it can be a bit of a pain (but of
course, works just fine). This patch lets you use a hostgroup or
servicegroup name as an argument to an on-demand macro, and then expands
the macro appropriately with respect to all the members of the group.
For example, instead of saying:
you can define a service group (using regular expressions in this case):
alias All DNS services
and then replace all of the SERVICESTATEID macros in the check_command
This will expand to all of the SERVICESTATEIDs of all of the services in
the All-DNS servicegroup, separated by commas. After this patch, there
are 4 ways to use on-demand macros:
The delimiter is used to separate the results after expanded (it doesn't
have to be a single character, but it will usually just be a comma).
Note that this adds an ambiguity with on-demand service macros. In order
to differentiate in between the last two lines above, Nagios will first
try to expand an on-demand service macro as a
$SERVICEMACRO:host:service$, and if that doesn't work (if host:service
doesn't exist), then Nagios will try it as
Please be forewarned; although I've done a little testing, I can't be
sure this doesn't introduce some new bug....