From 0b6423f9c99d9edf8c96fefd0f6c453859395aa1 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Mon, 30 Sep 2013 00:03:24 +0200 Subject: Import Nagios Plugins site Import the Nagios Plugins web site, Cronjobs, infrastructure scripts, and configuration files. --- web/attachments/116649-check_procs_perfdata.diff | 49 ++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 web/attachments/116649-check_procs_perfdata.diff (limited to 'web/attachments/116649-check_procs_perfdata.diff') 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 @@ +--- 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); + } -- cgit v1.2.3-74-g34f1