Unable to put in the "!" character

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
niebais
Posts: 349
Joined: Tue Apr 13, 2010 2:15 pm

Unable to put in the "!" character

Post 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?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Unable to put in the "!" character

Post by scottwilkerson »

I believe you need to escape this with a \
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
niebais
Posts: 349
Joined: Tue Apr 13, 2010 2:15 pm

Re: Unable to put in the "!" character

Post 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.
User avatar
niebais
Posts: 349
Joined: Tue Apr 13, 2010 2:15 pm

Re: Unable to put in the "!" character

Post 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.
User avatar
niebais
Posts: 349
Joined: Tue Apr 13, 2010 2:15 pm

Re: Unable to put in the "!" character

Post 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.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Unable to put in the "!" character

Post 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.
User avatar
niebais
Posts: 349
Joined: Tue Apr 13, 2010 2:15 pm

Re: Unable to put in the "!" character

Post 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?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Unable to put in the "!" character

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
niebais
Posts: 349
Joined: Tue Apr 13, 2010 2:15 pm

Re: Unable to put in the "!" character

Post 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.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Unable to put in the "!" character

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked