--- nagios-plugins-HEAD-200501200547/plugins/check_procs.c 2004-12-29 22:41:39.000000000 -0200 +++ check_procs.c 2005-01-20 14:37:19.000000000 -0200 @@ -54,6 +54,9 @@ #define ELAPSED 512 /* Different metrics */ char *metric_name; +char *perf_procs; +char *perf_metric; + enum metric { METRIC_PROCS, METRIC_VSZ, @@ -290,6 +293,36 @@ } printf (ngettext ("%d process", "%d processes", (unsigned long) procs), procs); + perf_procs = NULL; + perf_metric = NULL; + + if (metric == METRIC_PROCS) { + perf_procs = strscpy(perf_procs,perfdata("Processes", procs, "", + (wmax > 0), wmax , (cmax > 0), cmax , + 0, 0, 0, 0)); + } else { + perf_metric = strscpy(perf_metric, "Processes: Normal "); + perf_metric = strcat(perf_metric, metric_name); + perf_procs = strscpy(perf_procs, perfdata(perf_metric, procs, "", + 0, 0, 0, 0, + 0, 0, 0, 0)); + perf_metric = strscpy(perf_metric, "Processes: Warning "); + perf_metric = strcat(perf_metric, metric_name); + perf_procs = strcat(perf_procs, " "); + perf_procs = strcat(perf_procs, perfdata(perf_metric, warn, "", + 0, 0, 0, 0, + 0, 0, 0, 0)); + perf_metric = strscpy(perf_metric, "Processes: Critical "); + perf_metric = strcat(perf_metric, metric_name); + perf_procs = strcat(perf_procs, " "); + perf_procs = strcat(perf_procs, perfdata(perf_metric, crit, "", + 0, 0, 0, 0, + 1, 0, 0, 0)); + } + + printf (" | %s", perf_procs); + + if (strcmp(fmt,"") != 0) { printf (_(" with %s"), fmt); }