All,
I have some plugins that must be running depending of MACRO value.
For example:
IF $_HOST_APP_VERSION$ is 4.14.4, run the plugin $USER1$/app.py
BUT if $_HOST_APP_VERSION$ is 4.14SLA, run the plugin $USER1$/especiacommand.py
Unfortunately our automation the hostgroup for the HOSTS are always hostgroup-app-4.14. So, I cannot switch it by service definition. In the past, I have passing the __APP_VERSION macro at the command line and switch it inside the plugin. But now, the plugins are completely different with different actions.
Is there any way that I can configure Nagios services or commands to run different plugins based on Macro value?
Thank you,
Execute plugin based on MACRO content?
-
LillianNest
- Posts: 1
- Joined: Wed Jan 06, 2021 4:41 am
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Execute plugin based on MACRO content?
Hi Lillain,
Welcome to the Nagios Community Forum. And a happy new year!
You can store host variables that can be called by the wrapper script using the custom variables.
Custom Object Variables
Hope that helps.
--Benjamin
Welcome to the Nagios Community Forum. And a happy new year!
The usual course of action in this situation would be to write a wrapper script for the plugin that would check the condition and then call the appropriate plugin.Is there any way that I can configure Nagios services or commands to run different plugins based on Macro value?
You can store host variables that can be called by the wrapper script using the custom variables.
Custom Object Variables
Hope that helps.
--Benjamin
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!