Passing Macros Into Free Variables
Posted: Fri Sep 24, 2021 12:13 pm
Hello,
Does Nagios XI allow for passing custom macros into free variables? For example, we would like to pass a variable from the host to a service. The values are:
host free variables:
"_environment" = "development"
"_owner" = xxxxxxx
service free variables:
"_environment" = "$_HOSTENVIRONMENT"
Tailing /tmp/nagios-send-service-event.txt shows the Service Environment coming through as "$"
However, when we set service free variable "_environment" = "$HOSTOWNER" the Service Environment comes through with the correct Host Owner value. So it seems like the functionality is there to pass a macro through a free variable but for some reason we can't get it to work with the macro we've created ($_HOSTENVIRONMENT). Are custom macros not compatible with this?
Thanks for your time!
Does Nagios XI allow for passing custom macros into free variables? For example, we would like to pass a variable from the host to a service. The values are:
host free variables:
"_environment" = "development"
"_owner" = xxxxxxx
service free variables:
"_environment" = "$_HOSTENVIRONMENT"
Tailing /tmp/nagios-send-service-event.txt shows the Service Environment coming through as "$"
However, when we set service free variable "_environment" = "$HOSTOWNER" the Service Environment comes through with the correct Host Owner value. So it seems like the functionality is there to pass a macro through a free variable but for some reason we can't get it to work with the macro we've created ($_HOSTENVIRONMENT). Are custom macros not compatible with this?
Thanks for your time!