Page 1 of 1
Illegal characters in variable definition.
Posted: Mon Jan 04, 2016 11:14 am
by reinaldo.gomes
I'm getting the above error when trying to add a variable value through CCM, which contains '$'
How can I add such a value to a variable without causing Nagios any trouble? Can I just ignore it and add it through the config file itself?
Re: Illegal characters in variable definition.
Posted: Mon Jan 04, 2016 11:29 am
by hsmith
What are you trying to add the variable to?
Re: Illegal characters in variable definition.
Posted: Mon Jan 04, 2016 12:17 pm
by reinaldo.gomes
I need to add a password to a SQL connection through ODBI
Host Management -> Misc Settings -> Manage Variable Definitions:
Variable Name: _SOMEPASS
Variable Value: Pa$$
I'd rather use the odbc.ini file to set the password, but it seems that the FreeTDS driver does not support such parameter.
Re: Illegal characters in variable definition.
Posted: Mon Jan 04, 2016 12:25 pm
by rkennedy
You should be able to use the /usr/local/nagios/etc/resource.cfg file, and then define a custom $USER#$ variable.
From there, have your script reference the $USER#$ variable, rather than the password.
Re: Illegal characters in variable definition.
Posted: Tue Jan 05, 2016 12:12 pm
by reinaldo.gomes
I forgot to mention that my nagios version is 2012R2.9
I just found out that this issue is gone on version 5.x.x
Anyway, the resource.cfg did not work for me, for some reason... I'm still looking into it.
Re: Illegal characters in variable definition.
Posted: Tue Jan 05, 2016 12:19 pm
by hsmith
What do you mean that it didn't work for you?
Have you spun up a XI 5.2.3 test server to check?
Re: Illegal characters in variable definition.
Posted: Tue Jan 05, 2016 12:34 pm
by reinaldo.gomes
The resource.cfg thing wasn't working because it was using some "old" config... I ran 'service nagios reload' and now it's working
Yes, I had set up a 5.2.2 nagios server a couple weeks ago, but unfortunately I still couldn't make it go live due to my company's internal restrictions. I used it just now to test the 'illegal characters' issue.
Re: Illegal characters in variable definition.
Posted: Tue Jan 05, 2016 12:35 pm
by rkennedy
Ah. All is well now after restarting Nagios then?
Am I good to close this thread out?
Re: Illegal characters in variable definition.
Posted: Tue Jan 05, 2016 12:38 pm
by reinaldo.gomes
Yeah. So, I have to use the resource.cfg workaround for now, until I can move to v5.x.x
Thank you all.