Exclude kernel processes from check_procs without -k

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.
Locked
ZsZs73
Posts: 1
Joined: Mon Jun 23, 2014 7:05 am

Exclude kernel processes from check_procs without -k

Post by ZsZs73 »

Dear All,

I've been looking for a solution to check the number of processes with the standard check_procs plugin (without -k option) as we have this installed everywhere.

By googlong I've found some tries to solve this with no luck.
Also here is a thread http://support.nagios.com/forum/viewtopic.php?t=21508 about the same issue, where I can not post, so here is my solution:
On a modern systems with many cpu cores there can be a few hundred kernel processes (watchdog, migration, events, ata, crypto, ksoftirqd, kintegrityd, kblockd, etc) 'by default', which leads to the following on my server:

Code: Select all

./check_procs 
PROCS OK: 607 processes
If you want to exclude all of these kernel threads, just exclude all processes which name ends with ']'. This gives following on the same server:

Code: Select all

./check_procs --ereg-argument-array=[^]]$
PROCS OK: 75 processes with regex args '[^]]$'
I hope that it helps somebody.
Zsolt
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Exclude kernel processes from check_procs without -k

Post by tmcdonald »

Thanks for the tip! Since this was not a question you needed answers to I will be closing the thread, but if you do need anything in the future feel free to ask!
Former Nagios employee
Locked