Execute plugin based on MACRO content.
Posted: Tue Dec 15, 2020 2:12 pm
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,
Gerson Garcia
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,
Gerson Garcia