Service argument containing an exclamation mark

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
chrisp
Posts: 71
Joined: Fri Dec 28, 2012 11:35 am

Service argument containing an exclamation mark

Post by chrisp »

Hi,

I recently added a password to one of the argument fields on one of my services like so: -

Code: Select all

ARG1=pass!word
However, the password containing an exclamation mark (!) caused problems.

I was able to save the change to the service, but it didn't work as expected & upon investigation I re-edited the service and noted that the pass!word was now split across 2 argument fields like this: -

Code: Select all

ARG1=pass
ARG2=word
I've changed the password now, but thought it worthy of note...

Oddly, since adding these service checks (which still don't work as expected), the CCM seems very reluctant to show itself... Same goes for the Legacy CCM.

Right, I deleted all the new service checks with this issue, re-created one from the original (working) check & it still didn't work, so I changed the password again, so that it had no special characters.

This fixed the service check, so it seems like there's an issue with special characters in the CCM, because the same command syntax run from the CLI, works perfectly, but testing from the GUI or in normal use (Nagios scheduled checks), it borks.

This is an example similar to what I've got in this service: -

Code: Select all

$USER1$/check_http -I $HOSTADDRESS$ $ARG1$
ARG1=-H webmail.example.com -f follow -a '[email protected]:VTRBwbCA3'
So as well as the dodgy 5h0ck!horr0R password with exclamation mark issue noted above, passwords like DGexh$scv4 somehow get the system a bit upset and the checks fail.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Service argument containing an exclamation mark

Post by mguthrie »

Yeah, the exclamation mark is actually a delimiter for service arguments, so I wouldn't recommend it for passwords if you can help it. The dollars signs will work, but you just need to escape them.
http://support.nagios.com/wiki/index.ph ... ck_Command
User avatar
chrisp
Posts: 71
Joined: Fri Dec 28, 2012 11:35 am

Re: Service argument containing an exclamation mark

Post by chrisp »

Damn! I didn't even think about escaping the special characters...
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Service argument containing an exclamation mark

Post by slansing »

Closing thread and marking resolved. Thanks for letting us know what the issue was :).
Locked