diff options
Diffstat (limited to 'web/attachments/162122-check_procs.patch')
| -rw-r--r-- | web/attachments/162122-check_procs.patch | 30 |
1 files changed, 30 insertions, 0 deletions
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 @@ | |||
| 1 | --- nagios-plugins-1.4.2/plugins/check_procs.c 2005-09-15 08:27:58.000000000 +0000 | ||
| 2 | +++ check_procs.c 2006-01-04 15:22:53.684763668 +0000 | ||
| 3 | @@ -84,6 +84,7 @@ | ||
| 4 | char *input_buffer; | ||
| 5 | char *input_line; | ||
| 6 | char *procprog; | ||
| 7 | + char *tmp_out; | ||
| 8 | |||
| 9 | pid_t mypid = 0; | ||
| 10 | int procuid = 0; | ||
| 11 | @@ -300,7 +301,18 @@ | ||
| 12 | if ( verbose >= 1 && strcmp(fails,"") ) | ||
| 13 | printf (" [%s]", fails); | ||
| 14 | |||
| 15 | - printf ("\n"); | ||
| 16 | + /* add performance data */ | ||
| 17 | + if ( metric == METRIC_PROCS ) { | ||
| 18 | + printf ("|%s\n", perfdata (metric_name,procs,"",(wmax!=-1),wmax,(cmax!=-1),cmax,TRUE,0,FALSE,0)); | ||
| 19 | + } else { | ||
| 20 | + asprintf (&tmp_out, _("%s Processes OK"),metric_name); | ||
| 21 | + printf ("|%s", perfdata (tmp_out,procs,"",FALSE,0,FALSE,0,TRUE,0,FALSE,0)); | ||
| 22 | + asprintf (&tmp_out, _("%s Processes WARNING"),metric_name); | ||
| 23 | + printf (" %s", perfdata (tmp_out,warn,"",FALSE,0,FALSE,0,TRUE,0,FALSE,0)); | ||
| 24 | + asprintf (&tmp_out, _("%s Processes CRITICAL"),metric_name); | ||
| 25 | + printf (" %s\n", perfdata (tmp_out,crit,"",FALSE,0,FALSE,0,TRUE,0,FALSE,0)); | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | return result; | ||
| 29 | } | ||
| 30 | |||
