Page 1 of 1

Really weird issue with nrpe

Posted: Wed Aug 24, 2016 1:56 am
by jose_a_guardia
Hi!

I've a lot of NRPE servers, and works fine. However, in one server I get this issue:

SERVER NRPE
NRPE v.2.13
I run this command to check glassfish process status:

Code: Select all

root@srvglassfish:~# /usr/lib/nagios/plugins/check_procs -a glassfish -c 1:3
PROCS OK: 1 process with args 'glassfish'
This is OK, I have 1 proccess 'glassfish'

In nrpe.cfg I set up this:

Code: Select all

command[check_procs_glassfish]=/usr/lib/nagios/plugins/check_procs -a glassfish -c 1:3


SERVER NAGIOS

Nagios 4.1.1

In the Nagios server, I run this check manually:

Code: Select all

/usr/lib/nagios/plugins/check_nrpe -H NrpeServerIP -c check_procs_glassfish
PROCS OK: 2 processes with args 'glassfish'
Two processes???!!


If I stop the only glassfish process, the machine itself detect 0 process, and Nagios Server 1 process.

Thanks in advance.

Regards.

Re: Really weird issue with nrpe

Posted: Wed Aug 24, 2016 10:57 am
by lmiltchev
Can you run the following commands on the remote box and show the output?

Code: Select all

ps -ef | grep glassfish
/usr/lib/nagios/plugins/check_procs -a glassfish -c 1:3
Run these commands twice - once when the glassfish service running, and again when it is stopped.

Re: Really weird issue with nrpe

Posted: Fri Aug 26, 2016 5:53 am
by jose_a_guardia
With Glassfish RUNNING:

Code: Select all

root@glassfish:~# ps -ef | grep glassfish
root     22554 22535  0 10:48 pts/0    00:00:00 grep glassfish
root     31983     1  2 Aug23 ?        01:56:21 /opt/jdk1.6.0_45/bin/java -cp /opt/glassfish3/glassfish/modules/glassfish.jar  -...

Code: Select all

root@glassfish:~# /usr/lib/nagios/plugins/check_procs -a glassfish -c 1:3
PROCS OK: 1 process with args 'glassfish'

And now, with Glassfish process STOPPED:

Code: Select all

root@glassfish:~# ps -ef | grep glassfish
root     22856 22535  0 10:51 pts/0    00:00:00 grep glassfish

Code: Select all

root@glassfish:~# /usr/lib/nagios/plugins/check_procs -a glassfish -c 1:3
PROCS CRITICAL: 0 processes with args 'glassfish'
In localhost all works fine.

Thanks!

Re: Really weird issue with nrpe

Posted: Fri Aug 26, 2016 11:14 am
by lmiltchev
I was not able to recreate the issue. :(

I will have to discuss the problem with our developers.

I defined my command on the client as:

Code: Select all

command[check_procs_noargs]=/usr/local/nagios/libexec/check_procs -a httpd -c 1:3
I am using check_procs v.2.0.3.

Code: Select all

[root@192 ~]# /usr/local/nagios/libexec/check_procs -V
check_procs v2.0.3 (nagios-plugins 2.0.3)
I have 21 httpd processes running at the moment:

Code: Select all

[root@192 ~]# ps -ef | grep httpd | grep -v grep | wc -l
21
[root@192 ~]#
Testing the check locally on the client:

Code: Select all

[root@192 ~]# /usr/local/nagios/libexec/check_procs -a httpd -c 1:3
PROCS CRITICAL: 21 processes with args 'httpd' | procs=21;;1:3;0;
Testing it on the nagios server:

Code: Select all

[root@localhost libexec]# ./check_nrpe -H <client ip> -c check_procs_noargs
PROCS CRITICAL: 21 processes with args 'httpd' | procs=21;;1:3;0;