Given the following service and command configuration using Nagios 3.3.1…
notes this is the notes macro
command_line echo “$SERVICEDESC$ macro -> $_SERVICETESTMACRO$ notes -> $SERVICENOTES$” > /tmp/test.out
If I restart Nagios and pick up this config, then watch the /tmp/test.out file, I get the following
So, the gist here is that the custom $_SERVICETESTMACRO$ macro substitutes in a “$” if that custom variable is not defined in the config. This is different than the stock $SERVICENOTES$ macro that doesn’t get anything substituted in. I know this is sort of an uncommon occurrence, but it did cause me grief earlier today. My workaround was to use the notes variable/macro and it behaved properly.