diff options
author | Matthew Kent <mattkent@users.sourceforge.net> | 2004-11-19 03:44:13 +0000 |
---|---|---|
committer | Matthew Kent <mattkent@users.sourceforge.net> | 2004-11-19 03:44:13 +0000 |
commit | 20630de1405d538478c0c613f9922f548c4b5172 (patch) | |
tree | 190dd15069a9995575159fd38e514828a9ce3e1e | |
parent | 7ccca5ed7fe7623277243def84b5e369032b7e22 (diff) | |
download | monitoring-plugins-20630de1405d538478c0c613f9922f548c4b5172.tar.gz |
Enabling timeout flag (1010097, Jason Martin)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@908 f882894a-f735-0410-b71e-b25c423dba1c
-rw-r--r-- | plugins/check_procs.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/plugins/check_procs.c b/plugins/check_procs.c index 402daa53..3eefdb44 100644 --- a/plugins/check_procs.c +++ b/plugins/check_procs.c | |||
@@ -119,6 +119,15 @@ main (int argc, char **argv) | |||
119 | if (process_arguments (argc, argv) == ERROR) | 119 | if (process_arguments (argc, argv) == ERROR) |
120 | usage (_("Unable to parse command line\n")); | 120 | usage (_("Unable to parse command line\n")); |
121 | 121 | ||
122 | |||
123 | /* Set signal handling and alarm timeout */ | ||
124 | if (signal (SIGALRM, popen_timeout_alarm_handler) == SIG_ERR) { | ||
125 | printf (_("Cannot catch SIGALRM")); | ||
126 | return STATE_UNKNOWN; | ||
127 | } | ||
128 | alarm (timeout_interval); | ||
129 | |||
130 | |||
122 | if (verbose >= 2) | 131 | if (verbose >= 2) |
123 | printf (_("CMD: %s\n"), PS_COMMAND); | 132 | printf (_("CMD: %s\n"), PS_COMMAND); |
124 | 133 | ||
@@ -603,7 +612,11 @@ Optional Arguments:\n\ | |||
603 | PROCS - number of processes (default)\n\ | 612 | PROCS - number of processes (default)\n\ |
604 | VSZ - virtual memory size\n\ | 613 | VSZ - virtual memory size\n\ |
605 | RSS - resident set memory size\n\ | 614 | RSS - resident set memory size\n\ |
606 | CPU - percentage cpu\n\ | 615 | CPU - percentage cpu\n")); |
616 | |||
617 | printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT); | ||
618 | |||
619 | printf(_("\ | ||
607 | -v, --verbose\n\ | 620 | -v, --verbose\n\ |
608 | Extra information. Up to 3 verbosity levels\n")); | 621 | Extra information. Up to 3 verbosity levels\n")); |
609 | 622 | ||
@@ -664,7 +677,7 @@ print_usage (void) | |||
664 | printf ("\ | 677 | printf ("\ |
665 | Usage: %s -w <range> -c <range> [-m metric] [-s state] [-p ppid]\n\ | 678 | Usage: %s -w <range> -c <range> [-m metric] [-s state] [-p ppid]\n\ |
666 | [-u user] [-r rss] [-z vsz] [-P %%cpu] [-a argument-array]\n\ | 679 | [-u user] [-r rss] [-z vsz] [-P %%cpu] [-a argument-array]\n\ |
667 | [-C command] [-v]\n", progname); | 680 | [-C command] [-t timeout] [-v]\n", progname); |
668 | printf (_(UT_HLP_VRS), progname, progname); | 681 | printf (_(UT_HLP_VRS), progname, progname); |
669 | } | 682 | } |
670 | 683 | ||