Defining On-demand Macro in Host Group in CCM
Posted: Tue May 20, 2014 12:27 am
Hi.
We are using CCM to define our host groups; in this case, "linux-servers".
I have a bunch of checks that I assign to that host group.
I want to specify an on-demand macro in this host group (so I can use it as an environment var in a plugin).
A future host group, say, solaris-servers, may have a different value, but the plugin code wouldn't have to change.
Something like:
_LOGMONPATH /usr/local/nagios/etc/logmonpath
CCM appears to have very limited options for what kinds of things you can do with a Host Group definition.
Adding macros is not one of them.
Obviously, editing the cfg file is out as NagiosQL will just overwrite it.
Any ideas?
I think I'm stuck using CCM for this unless I can present a really compelling case otherwise.
Thanks very much.
Rick
We are using CCM to define our host groups; in this case, "linux-servers".
I have a bunch of checks that I assign to that host group.
I want to specify an on-demand macro in this host group (so I can use it as an environment var in a plugin).
A future host group, say, solaris-servers, may have a different value, but the plugin code wouldn't have to change.
Something like:
_LOGMONPATH /usr/local/nagios/etc/logmonpath
CCM appears to have very limited options for what kinds of things you can do with a Host Group definition.
Adding macros is not one of them.
Obviously, editing the cfg file is out as NagiosQL will just overwrite it.
Any ideas?
I think I'm stuck using CCM for this unless I can present a really compelling case otherwise.
Thanks very much.
Rick