Page 1 of 2
CheckProcState help required
Posted: Wed Apr 17, 2013 10:24 am
by and1100
Hi,
I am trying to have CheckProcState search for a java.exe with string 'fiseco' in the command line. As seen below in ProcExplorer.
I read
http://www.nsclient.org/nscp/wiki/Check ... kProcState and created my code as follows:
$USER1$/check_nrpe -H $HOSTADDRESS$ -c CheckProcState -a match=strings cmdLine ShowAll MinCritCount=0 MaxCritCount=2 .*java.exe.*$ARG1$.*=started
[NOTE: I've used match=regex before too with no luck]
check_nrpe_proc_java_fiseco1!.*fiseco.*=started
However, Nagios seems like it is unable to find the process at all. Any ideas?
Thank you for reading this and your assistance.
Re: CheckProcState help required
Posted: Wed Apr 17, 2013 5:27 pm
by abrist
What version of nsclient are you running?
and1100 wrote:
check_nrpe_proc_java_fiseco1!.*fiseco.*=started
However, Nagios seems like it is unable to find the process at all. Any ideas?
What error is being returned to nagios?
Re: CheckProcState help required
Posted: Wed Apr 17, 2013 6:22 pm
by and1100
I am using NSclient version 3.9.
The error returned is:
CRITICAL: .*java.exe.*.*java.*fiseco: 0 < critical
Re: CheckProcState help required
Posted: Wed Apr 17, 2013 9:02 pm
by and1100
I heard the issue was related to an older version of NSClient so I upgraded the latest version. However, when I try to run a checkCPU command I am getting the following error on the Nagios GUI:
Check CPU
UNKNOWN 04-17-2013 21:57:56 0d 0h 7m 14s 4/10 CHECK_NRPE: No output returned from daemon.
What is listed in the configuration tab for this: check_nrpe_checkcpu!80%!90%!
but... when I run the command via CLI to test...
[root@nagios libexec]# ./check_nrpe -H 1.1.1.1 -c checkcpu -a warn=80
OK CPU Load ok.
I am baffled. Any ideas?
Thanks.
Re: CheckProcState help required
Posted: Thu Apr 18, 2013 2:49 pm
by abrist
Can you post your command definition for " check_nrpe_checkcpu"?
Re: CheckProcState help required
Posted: Thu Apr 18, 2013 4:58 pm
by and1100
Hi Abrist,
I actually think I am close to resolving this. I have defined a service:
check_command check_nrpe!-H x.x.x.x -c CheckProcState -a MinCritCount=0 ShowAll match=regexp cmdLine .*java.*fiseco.*=started
Output on the GUI:
fiseco
CRITICAL 04-18-2013 17:54:21 0d 0h 3m 27s 5/10 CRITICAL: x.x.x.x: stopped < critical, "java" -cp ""c:xxfisecobin.."etc":"c:xxfisecobin..libtools.logging-0.2.3.jar":"c:xxfisecobin..libtools.cli-0.2.1.jar":"c:xxefisecobin..libslf4j-api-1.6.4.jar":"c:xx
It shows critical for some reason but I at least know that it is working now. However, when I run the command via CLI:
./check_nrpe -H x.x.x.x -c CheckProcState -a MinCritCount=0 ShowAll match=regexp cmdLine .*java.*fiseco.*=started
output:
OK: "java" -cp (+ the whole command line location)
Thanks for your help.
Re: CheckProcState help required
Posted: Thu Apr 18, 2013 5:13 pm
by and1100
This is also happening for my java.exe checkProc:
[root@nagios libexec]# ./check_nrpe -H x.x.x.x -c CheckProcState -a ShowAll MinCritCount=6 java.exe=started
OK: java.exe: running|'java.exe'=7;0;6
but when I enter it in the .cfg:
service_description Java procs
check_command check_nrpe!-H x.x.x.x -c CheckProcState -a ShowAll MinCritCount=6 java.exe=started
on the GUI:
CRITICAL 04-18-2013 18:12:01 0d 0h 6m 8s 7/10 CRITICAL: x.x.x.x: stopped < critical
Re: CheckProcState help required
Posted: Fri Apr 19, 2013 2:45 pm
by scottwilkerson
Try wrapping everything after the -a in single quotes
ie
Code: Select all
check_command check_nrpe!-H x.x.x.x -c CheckProcState -a 'MinCritCount=0 ShowAll match=regexp cmdLine .*java.*fiseco.*=started'
Re: CheckProcState help required
Posted: Fri Apr 19, 2013 4:50 pm
by and1100
I changed it to :
check_command check_nrpe!-H 1.1.1.1 -c CheckProcState -a 'MinCritCount=0 match=regexp cmdLine ShowAll .*java.*fiseco.*=started'
and I still receive: fiseco CRITICAL in the GUI.
It also seems that when I update my NSClient that the following gets broken too:
define command {
command_name check_nrpe_proc_java_fiseco1
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c CheckProcState -a match=regexp cmdLine ShowAll MinCritCount=6 $ARG1$
}
check_command check_nrpe_proc_java_fiseco1!java.exe=started
which I just use to check for the running Java processes shows up as critical on the GUI For 0.4.1 when the same exact syntax had previously worked in 0.3.9.
Re: CheckProcState help required
Posted: Mon Apr 22, 2013 11:16 am
by scottwilkerson
and1100 wrote:which I just use to check for the running Java processes shows up as critical on the GUI For 0.4.1 when the same exact syntax had previously worked in 0.3.9.
This sounds like a bug, I would recommend reporting your findings on the
NSClient site as it is not managed by us.