diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2003-11-28 14:18:22 +0000 |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2003-11-28 14:18:22 +0000 |
commit | 8f2a49eacd5ac6e9360d036c68a7e0a3e7701667 (patch) | |
tree | a02a94cda7462809f8922b0c960d063e0c40588f | |
parent | a8de4d5ce0f1ecdc8a50ead0348462e95d07a3be (diff) | |
download | monitoring-plugins-8f2a49eacd5ac6e9360d036c68a7e0a3e7701667.tar.gz |
Fixed listing of failed processes
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@779 f882894a-f735-0410-b71e-b25c423dba1c
-rw-r--r-- | plugins/check_procs.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/plugins/check_procs.c b/plugins/check_procs.c index a868fcf9..d4792107 100644 --- a/plugins/check_procs.c +++ b/plugins/check_procs.c @@ -202,12 +202,14 @@ main (int argc, char **argv) if (metric != METRIC_PROCS) { if (i == STATE_WARNING) { warn++; + asprintf (&fails, "%s%s%s", fails, (strcmp(fails,"") ? ", " : ""), procprog); + result = max_state (result, i); } if (i == STATE_CRITICAL) { crit++; + asprintf (&fails, "%s%s%s", fails, (strcmp(fails,"") ? ", " : ""), procprog); + result = max_state (result, i); } - asprintf (&fails, "%s%s%s", fails, (strcmp(fails,"") ? ", " : ""), procprog); - result = max_state (result, i); } } /* This should not happen */ @@ -341,7 +343,7 @@ process_arguments (int argc, char **argv) else usage (_("Critical Process Count must be an integer!\n\n")); break; - case 'w': /* warning time threshold */ + case 'w': /* warning threshold */ if (is_integer (optarg)) wmax = atoi (optarg); else if (sscanf (optarg, ":%d", &wmax) == 1) @@ -351,7 +353,7 @@ process_arguments (int argc, char **argv) else if (sscanf (optarg, "%d:", &wmin) == 1) break; else - usage (_("%s: Warning Process Count must be an integer!\n\n")); + usage (_("Warning Process Count must be an integer!\n\n")); break; case 'p': /* process id */ if (sscanf (optarg, "%d%[^0-9]", &ppid, tmp) == 1) { @@ -655,7 +657,9 @@ Examples:\n\ Warning alert if > 10 processes with command arguments containing \n\ '/usr/local/bin/perl' and owned by root\n\n\ check_procs -w 50000 -c 100000 --metric=VSZ\n\ - Alert if vsz of any processes over 50K or 100K\n\n")); + Alert if vsz of any processes over 50K or 100K\n\ + check_procs -w 10 -c 20 --metric=CPU\n\ + Alert if cpu of any processes over 10% or 20%\n\n")); printf (_(UT_SUPPORT)); } |