summaryrefslogtreecommitdiffstats
path: root/web/attachments/162122-check_procs.patch
blob: 55889fbb7372e2448df8cc289c010cd3d20efef3 (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
27
28
29
30
--- nagios-plugins-1.4.2/plugins/check_procs.c	2005-09-15 08:27:58.000000000 +0000
+++ check_procs.c	2006-01-04 15:22:53.684763668 +0000
@@ -84,6 +84,7 @@
 	char *input_buffer;
 	char *input_line;
 	char *procprog;
+        char *tmp_out;
 
 	pid_t mypid = 0;
 	int procuid = 0;
@@ -300,7 +301,18 @@
 	if ( verbose >= 1 && strcmp(fails,"") )
 		printf (" [%s]", fails);
 
-	printf ("\n");
+  /* add performance data */
+  if ( metric == METRIC_PROCS ) {
+    printf ("|%s\n", perfdata (metric_name,procs,"",(wmax!=-1),wmax,(cmax!=-1),cmax,TRUE,0,FALSE,0));
+  } else {
+    asprintf (&tmp_out, _("%s Processes OK"),metric_name);
+    printf ("|%s", perfdata (tmp_out,procs,"",FALSE,0,FALSE,0,TRUE,0,FALSE,0));
+    asprintf (&tmp_out, _("%s Processes WARNING"),metric_name);
+    printf (" %s", perfdata (tmp_out,warn,"",FALSE,0,FALSE,0,TRUE,0,FALSE,0));
+    asprintf (&tmp_out, _("%s Processes CRITICAL"),metric_name);
+    printf (" %s\n", perfdata (tmp_out,crit,"",FALSE,0,FALSE,0,TRUE,0,FALSE,0));
+  }
+
 	return result;
 }