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
Defining On-demand Macro in Host Group in CCM
-
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
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.
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.
Re: Defining On-demand Macro in Host Group in CCM
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.
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
That's probably your easiest option.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.