CheckProcState help required

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.
and1100
Posts: 93
Joined: Mon Mar 25, 2013 8:37 am

CheckProcState help required

Post 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.

Image

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.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: CheckProcState help required

Post 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?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
and1100
Posts: 93
Joined: Mon Mar 25, 2013 8:37 am

Re: CheckProcState help required

Post by and1100 »

I am using NSclient version 3.9.

The error returned is:

CRITICAL: .*java.exe.*.*java.*fiseco: 0 < critical
and1100
Posts: 93
Joined: Mon Mar 25, 2013 8:37 am

Re: CheckProcState help required

Post 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.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: CheckProcState help required

Post by abrist »

Can you post your command definition for " check_nrpe_checkcpu"?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
and1100
Posts: 93
Joined: Mon Mar 25, 2013 8:37 am

Re: CheckProcState help required

Post 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.
Last edited by and1100 on Thu Apr 18, 2013 6:29 pm, edited 1 time in total.
and1100
Posts: 93
Joined: Mon Mar 25, 2013 8:37 am

Re: CheckProcState help required

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: CheckProcState help required

Post 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'
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
and1100
Posts: 93
Joined: Mon Mar 25, 2013 8:37 am

Re: CheckProcState help required

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: CheckProcState help required

Post 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.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked