Defining On-demand Macro in Host Group in CCM

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
grenley
Posts: 96
Joined: Tue May 13, 2014 6:06 pm

Defining On-demand Macro in Host Group in CCM

Post by grenley »

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
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Defining On-demand Macro in Host Group in CCM

Post by slansing »

I'd highly recommend taking a look at this document:

http://assets.nagios.com/downloads/nagi ... ndlers.pdf

Specifically at the on-demand macros section. You should be able to add them just as you would in core, you should be able to add them in the MISC section of your Host/service ccm definition. I hope I didn't misunderstand your question.
grenley
Posts: 96
Joined: Tue May 13, 2014 6:06 pm

Re: Defining On-demand Macro in Host Group in CCM

Post by grenley »

Thanks very much for your reply.
I think what you're referring to doesn't allow me to set macros/environment variables for whole platforms (e.g., via a host group definition)
As I've begun to understand more about the product, I realize my questions are pretty naive and I apologize for that.
I'm thinking that I could just write a wrapper script that sets environment variables and then calls the plugin directly.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Defining On-demand Macro in Host Group in CCM

Post by scottwilkerson »

grenley wrote:Thanks very much for your reply.
I think what you're referring to doesn't allow me to set macros/environment variables for whole platforms (e.g., via a host group definition)
As I've begun to understand more about the product, I realize my questions are pretty naive and I apologize for that.
I'm thinking that I could just write a wrapper script that sets environment variables and then calls the plugin directly.
That's probably your easiest option.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked