Nagios XI converts plus sign (+) to whitespace

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
nytstevenlu
Posts: 12
Joined: Mon Mar 10, 2014 10:34 am

Nagios XI converts plus sign (+) to whitespace

Post by nytstevenlu »

Hi,

I was trying to set up a service to monitor our Oracle ASM diskgroup usage, and one of the arguments I use in the service check contains a plus sign (+).

Here is my service check:
[root@nagios01 scripts]# /usr/local/nagios/libexec/check_nrpe -n -t 30 -H foo.bar.com -c check_health_oracle -a '-t!ASMDISKSPACE!-I!+ASM!-p!FOOBAR'
OK - Disk space on FOOBAR is OK, 14755MB of 102396MB used (14.41%)
[root@nagios01 scripts]#
This works when I tested it using command line, however it does not work when I tested it using the Nagios XI web UI as the UI turns the plus sign (+) into a whitespace:
Testing check from command line...

COMMAND: /usr/local/nagios/libexec/check_nrpe -n -t 30 -H foo.bar.com -c check_health_oracle -a '-t ASMDISKSPACE -I ASM -p FOOBAR'
I tried escaping it using a backslash, however it does the following:
Testing check from command line...

COMMAND: /usr/local/nagios/libexec/check_nrpe -n -t 30 -H foo.bar.com -c check_health_oracle -a '-t ASMDISKSPACE -I \\ ASM -p FOOBAR'
Is there a way to escape the "+"? My service checks worked in Nagios Core perfectly, however they are all failing in Nagios XI due to the weird behavior.

Also, is it true that Nagios XI only supports 8 check arguments and does not convert $ARG9$ and beyond properly?

Thanks,
Steven
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Nagios XI converts plus sign (+) to whitespace

Post by slansing »

Have you tried escaping with one slash instead of two? You could use a $USERn$ macro for this, simply add one to:

Code: Select all

/usr/local/nagios/etc/resource.cfg
Restart nagios and pull it in using the macro itself, such as:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -n -t 30 -H foo.bar.com -c check_health_oracle -a '-t ASMDISKSPACE -I $USER6$ -p FOOBAR'
You can pull it directly into your arg section in the CCM, save, and apply configuration then check the service on the Home > Service Detail page.
nytstevenlu
Posts: 12
Joined: Mon Mar 10, 2014 10:34 am

Re: Nagios XI converts plus sign (+) to whitespace

Post by nytstevenlu »

I did use one slash, Nagios XI replaced it with two...

And is there a solution other than define a $USERn$? That sounds even less convenient than defining things in the nrpe client config.
nytstevenlu
Posts: 12
Joined: Mon Mar 10, 2014 10:34 am

Re: Nagios XI converts plus sign (+) to whitespace

Post by nytstevenlu »

I think I found the issue.

My checkcommand for that service was defined as:
$USER1$/check_nrpe -n -t 30 -H $HOSTADDRESS$ -c check_health_oracle -a '$ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$ $ARG6$ $ARG7$ $ARG8$'
And after I replaced the space with "!" everything started working.
$USER1$/check_nrpe -n -t 30 -H $HOSTADDRESS$ -c check_health_oracle -a '$ARG1$!$ARG2$!$ARG3$!$ARG4$!$ARG5$!$ARG6$!$ARG7$!$ARG8$'
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Nagios XI converts plus sign (+) to whitespace

Post by slansing »

Ah, that would do it as well, every arg must be appended with a (!) for the next one. You do not need to use them on the command line, only in your configurations.
Locked