Special Characters in passwords

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
hgch
Posts: 1
Joined: Fri Feb 08, 2013 10:03 am

Special Characters in passwords

Post by hgch »

Hi everyone


How can i use the special character ! in a password to check services with nagiosxi



thanks:::
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Special Characters in passwords

Post by mguthrie »

The ! is actually a delimiter for service arguments with Nagios, so I would recommend avoiding using them where possible. One workaround that can be done is that you can define either a custom macro for that password either as a service macro, or if it's a commonly used password, you can enter it as a global macro variable in the /usr/local/nagios/etc/resource.cfg file.
badcom
Posts: 11
Joined: Fri Oct 25, 2013 7:15 pm

Re: Special Characters in passwords

Post by badcom »

Hi,

I'm having this same issue.

My password contains ! and I can't change it.

I went to the /usr/local/nagios/etc/resource.cfg and added a $USER8$=password, but I'm not sure how I can use it.

Is it possible to use it when I'm testing the command manually? I.e.:

Code: Select all

 /usr/local/nagios/libexec/check_nrpe -H hostaddress -c check_fb -a '-u [email protected] -p $USER9$'
It didn't work.

Also, how do I add the $USER9$ to the check_command?

I have other passwords with the same issue. Will I have to create a check_command for each PW?

Cheers!
Last edited by badcom on Wed Nov 06, 2013 1:23 pm, edited 1 time in total.
badcom
Posts: 11
Joined: Fri Oct 25, 2013 7:15 pm

Re: Special Characters in passwords

Post by badcom »

Just to add one more information:

If I run the command from the remote server which is where the plugin is, it works:

Code: Select all

/usr/lib/nagios/plugins/check_fb.pl -u [email protected] -p 'passwordWith!Mark'
However, if I run the below command from the server, it won't work:

Code: Select all

 /usr/local/nagios/libexec/check_nrpe -H hostaddress -c check_fb -a '-u [email protected] -p passwordWith!Mark'
Locked