check_procs state=STATUSFLAGS Question

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
dhughes
Posts: 25
Joined: Thu Nov 14, 2013 2:24 pm

check_procs state=STATUSFLAGS Question

Post by dhughes »

Hello,

I am very new to Nagios XI. We are running nrpe on Solaris 10. Yesterday I used the Solaris wizard to put together a list to monitor - I downloaded the tar-ball and everything worked great.

After that I realized I wanted to monitor a process that runs on the system that is crucial to an application. It is only one process. I went into the Core Configuration Manager and chose "check_local_procs. For $ARG1 I chose 1 and did the same for $ARG2. For $ARG4 I put the name of the process.

Now my confusion lies in $ARG3 which is the "-s". I have search everywhere and I cannot find what R, Z, S, RS, and RSZDT stand for. When I use "R" and click "Test Check Command" it works, but I don't like things that work without me knowing why it's working.

Any explanation or pointing to the correct documentation would be most helpful

Thanks in advance,

Dan
dhughes
Posts: 25
Joined: Thu Nov 14, 2013 2:24 pm

Re: check_procs state=STATUSFLAGS Question

Post by dhughes »

I realized I need to put a 0 for $ARG2!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: check_procs state=STATUSFLAGS Question

Post by tmcdonald »

Ahh yes, the little things =)

Glad you figured it out, and welcome to XI!

From the check_procs help:

Code: Select all

 -s, --state=STATUSFLAGS
   Only scan for processes that have, in the output of `ps`, one or
   more of the status flags you specify (for example R, Z, S, RS,
   RSZDT, plus others based on the output of your 'ps' command).
And from http://www.vitki.net/hint/linux/what-does-rszdt-mean :
D Uninterruptible sleep (usually IO)
R Running or runnable (on run queue)
S Interruptible sleep (waiting for an event to complete)
T Stopped, either by a job control signal or because it is being traced.
W paging (not valid since kernel 2.6.xx)
X dead (should never be seen)
Z Defunct ("zombie") process, terminated but not reaped by its parent.
Former Nagios employee
dhughes
Posts: 25
Joined: Thu Nov 14, 2013 2:24 pm

Re: check_procs state=STATUSFLAGS Question

Post by dhughes »

Thanks - that is just what I was looking for.

Now, my second question is with the matrix of $ARG2 and $ARG3.

Now, here's where I get confused. For this example, I'll say I am monitoring a process that can have anywhere from 1 to 6 instances running at the same time, So I can see that wmax would be 6:1. Now, cmax is what should cause Nagios to alarm if there are no processes running, correct? What do I put there for cmax. If I put just a 0, the test fails. Do I use 1:0 so that id the process falls in between those two figures it will alarm?

Thanks in advance.
dhughes
Posts: 25
Joined: Thu Nov 14, 2013 2:24 pm

Re: check_procs state=STATUSFLAGS Question

Post by dhughes »

That should be $ARG1 and $ARG2 - sorry for the confusion.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_procs state=STATUSFLAGS Question

Post by scottwilkerson »

If you wanted to be a warning if you had less than 2 or more than 6 you would set

Code: Select all

$ARG1$ = 2:6
If you wanted to be a critical if you had less than 1 or more than 10 you would set

Code: Select all

$ARG2$ = 1:10
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
dhughes
Posts: 25
Joined: Thu Nov 14, 2013 2:24 pm

Re: check_procs state=STATUSFLAGS Question

Post by dhughes »

Thanks. But what if I'm only concerned if there is no process running.
dhughes
Posts: 25
Joined: Thu Nov 14, 2013 2:24 pm

Re: check_procs state=STATUSFLAGS Question

Post by dhughes »

Plus, usually there is only one process running, but sometimes one or two others may get started.
dhughes
Posts: 25
Joined: Thu Nov 14, 2013 2:24 pm

Re: check_procs state=STATUSFLAGS Question

Post by dhughes »

Is there a way for Nagios to just look to see if the process is there, regardless of the number of instances and only alarm if it's not there?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: check_procs state=STATUSFLAGS Question

Post by abrist »

You could try:

Code: Select all

$ARG1$ = 1:
$ARG2$ = 1:
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.
Locked