Illegal characters in variable definition.

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
reinaldo.gomes
Posts: 59
Joined: Wed Apr 02, 2014 9:29 am

Illegal characters in variable definition.

Post 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?
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Illegal characters in variable definition.

Post by hsmith »

What are you trying to add the variable to?
Former Nagios Employee.
me.
reinaldo.gomes
Posts: 59
Joined: Wed Apr 02, 2014 9:29 am

Re: Illegal characters in variable definition.

Post 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.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Illegal characters in variable definition.

Post 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.
Former Nagios Employee
reinaldo.gomes
Posts: 59
Joined: Wed Apr 02, 2014 9:29 am

Re: Illegal characters in variable definition.

Post 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 :roll:

Anyway, the resource.cfg did not work for me, for some reason... I'm still looking into it.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Illegal characters in variable definition.

Post 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?
Former Nagios Employee.
me.
reinaldo.gomes
Posts: 59
Joined: Wed Apr 02, 2014 9:29 am

Re: Illegal characters in variable definition.

Post 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.
Last edited by reinaldo.gomes on Tue Jan 05, 2016 12:36 pm, edited 1 time in total.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Illegal characters in variable definition.

Post by rkennedy »

Ah. All is well now after restarting Nagios then?

Am I good to close this thread out?
Former Nagios Employee
reinaldo.gomes
Posts: 59
Joined: Wed Apr 02, 2014 9:29 am

Re: Illegal characters in variable definition.

Post 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.
Locked