summaryrefslogtreecommitdiffstats
path: root/web/attachments/116649-check_procs_perfdata.diff
diff options
context:
space:
mode:
Diffstat (limited to 'web/attachments/116649-check_procs_perfdata.diff')
-rw-r--r--web/attachments/116649-check_procs_perfdata.diff49
1 files changed, 49 insertions, 0 deletions
diff --git a/web/attachments/116649-check_procs_perfdata.diff b/web/attachments/116649-check_procs_perfdata.diff
new file mode 100644
index 0000000..94bcddf
--- /dev/null
+++ b/web/attachments/116649-check_procs_perfdata.diff
@@ -0,0 +1,49 @@
1--- nagios-plugins-HEAD-200501200547/plugins/check_procs.c 2004-12-29 22:41:39.000000000 -0200
2+++ check_procs.c 2005-01-20 14:37:19.000000000 -0200
3@@ -54,6 +54,9 @@
4 #define ELAPSED 512
5 /* Different metrics */
6 char *metric_name;
7+char *perf_procs;
8+char *perf_metric;
9+
10 enum metric {
11 METRIC_PROCS,
12 METRIC_VSZ,
13@@ -290,6 +293,36 @@
14 }
15 printf (ngettext ("%d process", "%d processes", (unsigned long) procs), procs);
16
17+ perf_procs = NULL;
18+ perf_metric = NULL;
19+
20+ if (metric == METRIC_PROCS) {
21+ perf_procs = strscpy(perf_procs,perfdata("Processes", procs, "",
22+ (wmax > 0), wmax , (cmax > 0), cmax ,
23+ 0, 0, 0, 0));
24+ } else {
25+ perf_metric = strscpy(perf_metric, "Processes: Normal ");
26+ perf_metric = strcat(perf_metric, metric_name);
27+ perf_procs = strscpy(perf_procs, perfdata(perf_metric, procs, "",
28+ 0, 0, 0, 0,
29+ 0, 0, 0, 0));
30+ perf_metric = strscpy(perf_metric, "Processes: Warning ");
31+ perf_metric = strcat(perf_metric, metric_name);
32+ perf_procs = strcat(perf_procs, " ");
33+ perf_procs = strcat(perf_procs, perfdata(perf_metric, warn, "",
34+ 0, 0, 0, 0,
35+ 0, 0, 0, 0));
36+ perf_metric = strscpy(perf_metric, "Processes: Critical ");
37+ perf_metric = strcat(perf_metric, metric_name);
38+ perf_procs = strcat(perf_procs, " ");
39+ perf_procs = strcat(perf_procs, perfdata(perf_metric, crit, "",
40+ 0, 0, 0, 0,
41+ 1, 0, 0, 0));
42+ }
43+
44+ printf (" | %s", perf_procs);
45+
46+
47 if (strcmp(fmt,"") != 0) {
48 printf (_(" with %s"), fmt);
49 }