diff options
Diffstat (limited to 'web/attachments/430067-check_proc-perfdata.patch')
-rw-r--r-- | web/attachments/430067-check_proc-perfdata.patch | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/web/attachments/430067-check_proc-perfdata.patch b/web/attachments/430067-check_proc-perfdata.patch new file mode 100644 index 0000000..a7f409a --- /dev/null +++ b/web/attachments/430067-check_proc-perfdata.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | --- nagios-plugins-1.4.15/plugins/check_procs.c 2010-07-27 22:47:16.000000000 +0200 | ||
2 | +++ /home/goesta/Projekte/Nagios/nagios-plugins_procs_perfpatch/plugins/check_procs.c 2009-12-19 01:12:49.924399127 +0100 | ||
3 | @@ -92,6 +92,7 @@ | ||
4 | char *fmt; | ||
5 | char *fails; | ||
6 | char tmp[MAX_INPUT_BUFFER]; | ||
7 | +int print_perfdata = 0; | ||
8 | |||
9 | FILE *ps_input = NULL; | ||
10 | |||
11 | @@ -293,6 +294,9 @@ | ||
12 | } | ||
13 | } | ||
14 | printf (ngettext ("%d process", "%d processes", (unsigned long) procs), procs); | ||
15 | + if ( print_perfdata == 1 ) { | ||
16 | + printf ("|procs=%d;%d;%d;0;", procs, wmax, cmax); | ||
17 | + } | ||
18 | |||
19 | if (strcmp(fmt,"") != 0) { | ||
20 | printf (_(" with %s"), fmt); | ||
21 | @@ -331,6 +335,7 @@ | ||
22 | {"pcpu", required_argument, 0, 'P'}, | ||
23 | {"elapsed", required_argument, 0, 'e'}, | ||
24 | {"argument-array", required_argument, 0, 'a'}, | ||
25 | + {"perfdata", no_argument, 0, 'd'}, | ||
26 | {"help", no_argument, 0, 'h'}, | ||
27 | {"version", no_argument, 0, 'V'}, | ||
28 | {"verbose", no_argument, 0, 'v'}, | ||
29 | @@ -344,7 +349,7 @@ | ||
30 | strcpy (argv[c], "-t"); | ||
31 | |||
32 | while (1) { | ||
33 | - c = getopt_long (argc, argv, "Vvht:c:w:p:s:u:C:a:z:r:m:P:", | ||
34 | + c = getopt_long (argc, argv, "Vvhdt:c:w:p:s:u:C:a:z:r:m:P:", | ||
35 | longopts, &option); | ||
36 | |||
37 | if (c == -1 || c == EOF) | ||
38 | @@ -505,6 +510,9 @@ | ||
39 | case CHAR_MAX+2: | ||
40 | input_filename = optarg; | ||
41 | break; | ||
42 | + case 'd': | ||
43 | + print_perfdata = 1; | ||
44 | + break; | ||
45 | } | ||
46 | } | ||
47 | |||