check_procs state=STATUSFLAGS Question
check_procs state=STATUSFLAGS Question
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
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
Re: check_procs state=STATUSFLAGS Question
I realized I need to put a 0 for $ARG2!
Re: check_procs state=STATUSFLAGS Question
Ahh yes, the little things =)
Glad you figured it out, and welcome to XI!
From the check_procs help:
And from http://www.vitki.net/hint/linux/what-does-rszdt-mean :
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).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
Re: check_procs state=STATUSFLAGS Question
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.
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.
Re: check_procs state=STATUSFLAGS Question
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
If you wanted to be a warning if you had less than 2 or more than 6 you would set
If you wanted to be a critical if you had less than 1 or more than 10 you would set
Code: Select all
$ARG1$ = 2:6Code: Select all
$ARG2$ = 1:10Re: check_procs state=STATUSFLAGS Question
Thanks. But what if I'm only concerned if there is no process running.
Re: check_procs state=STATUSFLAGS Question
Plus, usually there is only one process running, but sometimes one or two others may get started.
Re: check_procs state=STATUSFLAGS Question
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?
Re: check_procs state=STATUSFLAGS Question
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.
"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.