summaryrefslogtreecommitdiffstats
path: root/web/attachments/171745-nagios-plugins-1.4.2-check_procs_zombies.patch
blob: 3ba88bf5c03594b0841a957b9ca269b15a9280e1 (plain)
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.2/plugins/check_procs.c nagios-plugins-1.4.2-check_proc_zombies/plugins/check_procs.c
--- nagios-plugins-1.4.2/plugins/check_procs.c	2005-09-15 10:27:58.000000000 +0200
+++ nagios-plugins-1.4.2-check_proc_zombies/plugins/check_procs.c	2006-03-21 20:22:50.883708900 +0100
@@ -166,6 +166,7 @@
 		strcpy (procprog, "");
 		asprintf (&procargs, "%s", "");
 
+		pos = 0;
 		cols = sscanf (input_line, PS_FORMAT, PS_VARLIST);
 
 		/* Zombie processes do not give a procprog command */
@@ -174,8 +175,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 */
 #ifdef HAVE_BASENAME