[Nagiosplug-devel] [ nagiosplug-Feature Requests-3088023 ] check_procs Process State Matching

SourceForge.net noreply at sourceforge.net
Wed Jan 26 13:54:04 CET 2011

Feature Requests item #3088023, was opened at 2010-10-15 12:38
Message generated for change (Comment added) made by spacefreak
You can respond by visiting: 

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Priority: 5
Private: No
Submitted By: J. Bern (j-bern)
Assigned to: Nobody/Anonymous (nobody)
Summary: check_procs Process State Matching

Initial Comment:
[Checked with 1.4.14 on CentOS 5.5]

SUMMARY: Please provide state-matching options better suited for multi-character "stat" fields in the "ps" output.

DETAILS: check_procs.c effectively does the state matching with a strstr(command_line_parameter,stat_field_of_ps_output). That's OK for platforms where the state is a single character, like the "S", "R", etc. mentioned in the plugin's online help. Linux, and supposedly several more platforms, however use multi-character not-fully-specified-order states:

# ./check_procs -vv | grep '^Ma[t]ched:' | sed -e 's/.* \(stat=[^ ]*\) .*/\1/' | sort -u | tr '\n' ' '
stat=R stat=R+ stat=RN stat=Rs stat=S stat=S< stat=S+ stat=SLs stat=SN stat=Ss stat=S<s stat=Ss+ stat=Ssl stat=S<sl

EXAMPLE 1: check_procs *cannot* match Nagios' own master process (stat=Ssl or Rsl; there should be only one!)  without matching all its temp children (stat=S or R) as well.

EXAMPLE 2: To match "all nonblocked processes" (state=R* or S*, as opposed to D*, T*, or Z*), one would have to construct an "-s" parameter which contains all possible variations as explicit substrings ... which is prohibitive.

SUGGESTION (if I may): Two new options which implement "*all* characters from stat must appear in parameter" and "*one* character from stat needs to appear in parameter" and can be combined would IMHO go a long way.

WHY AM I NOT DOING THIS MYSELF: Sorry, Linux is currently the only platform I have available ...


Comment By: Thomas Oettli (spacefreak)
Date: 2011-01-26 13:54

I've got the same problem here.
Currently, I'm checking a lot Linux servers for zombie processes, this is
working well so far.
Today, one machine had a lot of hanging backup processes and I was
wondering, why the plugin didn't recognize that.

After some debugging, I've seen that these processes had the state ZN
(zombie with low-priority).

In fact it isn't important for me if zombie processes have a lower
priority or not, I would like to be able to count all processes which have
a "Z" in their state.

POSSIBLE SOLUTION: Please implement a method to match the state with
wild-cards or a regular expression (e.g. --state="*Z*" or


You can respond by visiting: 

More information about the Devel mailing list