summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Hartge <sven@svenhartge.de>2023-11-28 12:21:05 (GMT)
committerSven Hartge <sven@svenhartge.de>2023-11-28 12:21:05 (GMT)
commit897e4a840929285b0a29237e12f4aa9b702f41ce (patch)
treece6a5340b72bc884e5a8ac4bda9c49a23cd7cff6
parentc2ddda30e043bb62b30ca5d25dba8379697b6340 (diff)
downloadmonitoring-plugins-897e4a840929285b0a29237e12f4aa9b702f41ce.tar.gz
check_procs: ignore our own childrenrefs/pull/1968/head
On systems with higher core counts check_procs will occasionally see its own "ps" child process with a high CPU percentage and raise a false alarm. Ignoring the child processes of check_procs prevents this from happening.
-rw-r--r--plugins/check_procs.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/check_procs.c b/plugins/check_procs.c
index 6e3feae..3c98866 100644
--- a/plugins/check_procs.c
+++ b/plugins/check_procs.c
@@ -255,6 +255,13 @@ main (int argc, char **argv)
255 continue; 255 continue;
256 } 256 }
257 257
258 /* Ignore our own children */
259 if (procppid == mypid) {
260 if (verbose >= 3)
261 printf("not considering - is our child\n");
262 continue;
263 }
264
258 /* Ignore excluded processes by name */ 265 /* Ignore excluded processes by name */
259 if(options & EXCLUDE_PROGS) { 266 if(options & EXCLUDE_PROGS) {
260 int found = 0; 267 int found = 0;