1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
diff -Naur nagios-plugins-1.4.5/plugins/check_procs.c nagios-plugins-1.4.5-patched/plugins/check_procs.c
--- nagios-plugins-1.4.5/plugins/check_procs.c 2006-10-23 00:03:31.000000000 +0200
+++ nagios-plugins-1.4.5-patched/plugins/check_procs.c 2007-01-04 12:00:46.512560576 +0100
@@ -181,6 +181,7 @@
strcpy (procprog, "");
asprintf (&procargs, "%s", "");
+ pos = 0;
cols = sscanf (input_line, PS_FORMAT, PS_VARLIST);
/* Zombie processes do not give a procprog command */
@@ -189,8 +190,12 @@
}
if ( cols >= expected_cols ) {
resultsum = 0;
- asprintf (&procargs, "%s", input_line + pos);
- strip (procargs);
+ if (strstr(procstat, zombie)) {
+ procargs = "";
+ } else {
+ asprintf (&procargs, "%s", input_line + pos);
+ strip (procargs);
+ }
/* Some ps return full pathname for command. This removes path */
procprog = base_name(procprog);
|