Sign "+" in $ARGn$

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
bamsas
Posts: 3
Joined: Mon Aug 11, 2014 4:38 pm

Sign "+" in $ARGn$

Post by bamsas »

CentOS release 6.6 (Final) 64bit, manual install on VMware VM, Nagios XI 2014R2.0 - nothing special.

I developed script for Tomcat monitoring, it works from command line:

Code: Select all

[root@nagios libexec]# ./check_bamsas_tomcat.pl -v -H hds1.prod.bamsas.com --port=8081 --url='/nagios.jsp' --name='Catalina:type=ThreadPool,name="http-nio-8080"' --attr='connectionCount+currentThreadCount+currentThreadsBusy'
OK - connectionCount: 8 |  connectionCount=8 currentThreadCount=161 currentThreadsBusy=2
I created Nagios command and service:

Code: Select all

$USER1$/check_bamsas_tomcat.pl -v -H $HOSTADDRESS$ --port=8081 --url='$ARG1$' --name='$ARG2$' --attr='$ARG3$' $ARG4$ $ARG5$
and tried to use it with args:
$ARG1$ /nagios.jsp
$ARG2$ Catalina:type=ThreadPool,name="http-nio-8080"
$ARG3$ connectionCount+currentThreadCount+currentThreadsBusy
$ARG4$ -w 2048 -c 3072

Test check command returns:

Code: Select all

Testing check from command line...
COMMAND: /usr/local/nagios/libexec/check_bamsas_tomcat.pl -v -H hds1.prod.bamsas.com --port=8081 --url='/nagios.jsp' --name='Catalina:type=ThreadPool,name="http-nio-8080"' --attr='connectionCount currentThreadCount currentThreadsBusy' -w 2048 -c 3072 
OUTPUT: OK - connectionCount currentThreadCount currentThreadsBusy:  |
So, Nagios removed my "+" from $ARG3$
How can I resolve this issue?
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Sign "+" in $ARGn$

Post by jdalrymple »

That's wicked strange:

Code: Select all

[jdalrymple@localhost services]$ grep "+" /usr/local/nagios/var/status.dat
        check_command=check_dummy!0!this+that!!!!!!
        plugin_output=OK: this+that
What do you get if you fix it in the service description instead of setting it as an arg? I'm not sure where it's getting stripped.
bamsas
Posts: 3
Joined: Mon Aug 11, 2014 4:38 pm

Re: Sign "+" in $ARGn$

Post by bamsas »

Yes, that's really strange....
I activated service and applied configuration - it works as well. I see all 3 graphs.
[root@nagios libexec]# grep "+" /usr/local/nagios/var/status.dat
check_command=bamsas-check-tomcat!/nagios.jsp!Catalina:type=ThreadPool,name="http-nio-8080"!connectionCount+currentThreadCount+currentThreadsBusy!-w 2048 -c 3072!!!!

So, only one thing doesn't work: "Test Check Command" button. I will survive with it :-)
Thank you!
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Sign "+" in $ARGn$

Post by jdalrymple »

Ahh - test check command should never be relied upon, too much mystical Internet junk at play. I was under the impression that it wasn't in play since we're in the Core forum section.

Locking it up OK?
bamsas
Posts: 3
Joined: Mon Aug 11, 2014 4:38 pm

Re: Sign "+" in $ARGn$

Post by bamsas »

Yes, looks OK: 3 graphs, 3 gauges - everything is on place.
Please lock it.
Locked