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/162122-check_procs.patch | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 web/attachments/162122-check_procs.patch (limited to 'web/attachments/162122-check_procs.patch') diff --git a/web/attachments/162122-check_procs.patch b/web/attachments/162122-check_procs.patch new file mode 100644 index 0000000..55889fb --- /dev/null +++ b/web/attachments/162122-check_procs.patch @@ -0,0 +1,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; + } + -- cgit v1.2.3-74-g34f1