Page 1 of 2
Unable to put in the "!" character
Posted: Mon Oct 15, 2012 1:33 pm
by niebais
OS: Centos 6.2
Nagios XI 2012R1.0
When I try adding a "!" character to the args field, it doesn't save the character even when I put quotes around it. Is there a workaround for this?
Re: Unable to put in the "!" character
Posted: Mon Oct 15, 2012 3:46 pm
by scottwilkerson
I believe you need to escape this with a \
Re: Unable to put in the "!" character
Posted: Mon Oct 15, 2012 5:10 pm
by niebais
I tried that. In this version of Nagios XI it removes the character and sometimes even puts the ARGS on the next line.
Re: Unable to put in the "!" character
Posted: Mon Oct 15, 2012 5:48 pm
by niebais
The main problem is when you try adding in a ! or if you have that as a password, for example, in the WMI wizard. I can't get this to work with any number of combinations I've tried.
Re: Unable to put in the "!" character
Posted: Tue Oct 16, 2012 1:14 am
by niebais
One temporary solution is to put the special characters in the "command" instead of in the arguments. I got around it, but would really like to get this bug fixed up.
Re: Unable to put in the "!" character
Posted: Tue Oct 16, 2012 9:31 am
by mguthrie
Yeah, the other possibility would be to put the password in the resource.cfg, but if you've got a LOT of passwords to store, that probably won't work terribly well. That'll be a bit of a tricky bug since the ! also acts as the argument separator in the service command, but we'll definitely get it added to the list.
Re: Unable to put in the "!" character
Posted: Thu May 30, 2013 1:34 pm
by niebais
This is actually a bigger problem than I first thought. The "!" has problems saving anywhere as well. I have another client that uses that symbol in their snmp community string and it errors out as well. The resource.cfg file is ok for one or two items, but is a real problem when you have over 100. In this case there are about 1000 different servers. What would you suggest here? Is there a fix for this I can apply or upgrade to?
Re: Unable to put in the "!" character
Posted: Thu May 30, 2013 1:39 pm
by abrist
niebais wrote: Is there a fix for this I can apply or upgrade to?
There is not. The char "!" is a meta character for nagios arguments. resources.cfg is the *only* option if you use this character. It is generally best practice to avoid using $ ! # ^ | ; in your objects/settings/names/passwords as these are considered meta characters by *many* programs.
Re: Unable to put in the "!" character
Posted: Thu May 30, 2013 2:34 pm
by niebais
Yeah I realize that the "!" shouldn't be used, however, 99% of the customers don't think that way and use it thinking it should be ok. It's hard to change large companies password's when you are there as well.
Re: Unable to put in the "!" character
Posted: Thu May 30, 2013 2:44 pm
by abrist
niebais wrote:Yeah I realize that the "!" shouldn't be used, however, 99% of the customers don't think that way and use it thinking it should be ok.
Truth. I wish we had a work around, but this is hard-coded into core. It is generally good practice to include non-alpha-numerics in passwords, but there are some chars that I wish were flat out restricted for names/passwords/etc on all platforms.