Page 1 of 1

$ sign in free variables

Posted: Wed Jun 03, 2026 4:47 am
by nagios-retail
Since the update to Nagios XI 2026R1.5, it seems that free variables that contain a $ sign are not longer correctly replaced.
Example:
a host has this variable: _wmi_msas_name with value MSOLAP$HVWNLSQLTST
a service uses this as follows: check_ncpa.py ... -M 'windowscounters/$_HOSTWMI_MSAS_NAME$:Memory/Memory Usage KB'

In Nagios XI 2026R1.4, the windows counter was correct, in Nagios XI 2026R1.5, the $ sign is removed from the counter.
I tried to escape it ($$, /$) but no success.

Any ideas?

Re: $ sign in free variables

Posted: Wed Jun 03, 2026 9:38 am
by ekapsner
@nagios-retail,

Custom variable macros are now being stripped of dangerous characters due to security concerns. In /usr/local/nagios/etc/nagios.cfg, there is the illegal_macro_output_chars config option, which determines which characters are stripped from macros. If you want to use a $ sign in custom variable macros, edit the default option from `~$&|'"<> to `~&|'"<> and restart Core.

I'm sorry for any inconvenience this update may have caused and please let me know if you have any other questions.

- Emmett

Re: $ sign in free variables

Posted: Thu Jun 04, 2026 1:14 am
by kg2857
Its probably best to not use unix reserved characters.