Page 1 of 1

Exclude kernel processes from check_procs without -k

Posted: Mon Jun 23, 2014 8:24 am
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

Re: Exclude kernel processes from check_procs without -k

Posted: Mon Jun 23, 2014 9:03 am
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!