Execute plugin based on MACRO content.

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
GersonGarcia
Posts: 2
Joined: Tue Aug 05, 2014 5:52 pm

Execute plugin based on MACRO content.

Post by GersonGarcia »

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
Locked