[Nagiosplug-devel] [ nagiosplug-Feature Requests-2458521 ] Add performance data to check_procs plugin

SourceForge.net noreply at sourceforge.net
Wed Nov 14 21:08:36 CET 2012


Feature Requests item #2458521, was opened at 2008-12-22 05:10
Message generated for change (Comment added) made by hweiss
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397600&aid=2458521&group_id=29880

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
>Status: Closed
Priority: 5
Private: No
Submitted By: Jan Ondrej (ondrejj)
Assigned to: Nobody/Anonymous (nobody)
Summary: Add performance data to check_procs plugin

Initial Comment:
check_procs plugin has no performance data. It can be nice to display performance data for number of processes or zombie processes.
I have my own perfdata wrapper until this will be a part of nagios-plugins, but my wrapper has very limited functionality.
You only need to display this at end of line from check_plugin:

|procs=NUMBER_OF_PROCS;WARN_PROC_COUNT;CRITICAL_PROC_COUNT;0

Attaching my wrapper, which does this, but it's not a right way. :)


----------------------------------------------------------------------

>Comment By: Holger Weiss (hweiss)
Date: 2012-11-14 12:08

Message:
In the next release, the check_procs plugin will provide performance data.

----------------------------------------------------------------------

Comment By: Paul M. Dubuc (dubuc)
Date: 2012-08-14 14:15

Message:
Please consider patching with this enhanced version from nagios exchange: 
http://exchange.nagios.org/directory/Plugins/Operating-Systems/Linux/check_procs_perf/details

----------------------------------------------------------------------

Comment By: J.M. Roth (jmroth)
Date: 2011-01-27 04:37

Message:
Please forget my previous patch.

I see there are several patches already listed: ID#
2918676
1106840
1396989
The oldest one is from 2005 :-\

Additionally, here is my current one against 1.4.15

--- check_procs-old.c   2010-07-27 22:47:16.000000000 +0200
+++ check_procs.c       2011-01-27 13:34:19.000000000 +0100
@@ -301,6 +301,35 @@
        if ( verbose >= 1 && strcmp(fails,"") )
                printf (" [%s]", fails);

+       printf ("|procs=%d", procs);
+       if (wmin == -1) {
+         if (wmax == -1) {
+           printf (";");
+         } else {
+           printf (";:%d", wmax);
+         }
+       } else {
+         if (wmax == -1) {
+           printf (";%d:", wmin);
+         } else {
+           printf (";%d:%d", wmin, wmax);
+         }
+       }
+       if (cmin == -1) {
+         if (cmax == -1) {
+           printf (";");
+         } else {
+           printf (";:%d", cmax);
+         }
+       } else {
+         if (cmax == -1) {
+           printf (";%d:", cmin);
+         } else {
+           printf (";%d:%d", cmin, cmax);
+         }
+       }
+       printf (";1");
+
        printf ("\n");
        return result;
 }


----------------------------------------------------------------------

Comment By: J.M. Roth (jmroth)
Date: 2011-01-27 01:07

Message:
here's a diff to add performance data to check_procs.c

--- check_procs-old.c   2010-07-27 22:47:16.000000000 +0200
+++ check_procs.c       2011-01-27 10:02:08.000000000 +0100
@@ -301,6 +301,7 @@
        if ( verbose >= 1 && strcmp(fails,"") )
                printf (" [%s]", fails);

+       printf ("|procs=%d;%d;%d;%d:%d;%d:%d", procs, warn, crit, wmin,
wmax, cmin, cmax);
        printf ("\n");
        return result;
 }


----------------------------------------------------------------------

Comment By: GreenRover (greenrover)
Date: 2009-03-06 05:09

Message:
Her as the original check_procs.c

/root/nagios-plugins-1.4.13/plugins/check_procs.c
row 308 befor "	printf ("\n");"
add:
	printf (" | ");
	printf (ngettext ("process=%d", "processes=%d", (unsigned long) procs),
procs);
	printf (";%d;%d", wmax, cmax);

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397600&aid=2458521&group_id=29880




More information about the Devel mailing list