diff options
author | Thomas Guyot-Sionnest <dermoth@aei.ca> | 2009-03-24 21:40:06 -0400 |
---|---|---|
committer | Thomas Guyot-Sionnest <dermoth@aei.ca> | 2009-03-24 21:40:06 -0400 |
commit | 386b791af2a5c9d95531d2ca047dd8ffc12bcb2e (patch) | |
tree | 8ee5cd653d314e7e097da9fc5ea26642cd7d7769 /plugins/netutils.c | |
parent | ab3ada9aacd82356a6e5205f3ae26bbff55524db (diff) | |
download | monitoring-plugins-386b791af2a5c9d95531d2ca047dd8ffc12bcb2e.tar.gz |
Make socket alarm handler customisable (like c459ca07)
Diffstat (limited to 'plugins/netutils.c')
-rw-r--r-- | plugins/netutils.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/plugins/netutils.c b/plugins/netutils.c index 6082cae0..1d6100ab 100644 --- a/plugins/netutils.c +++ b/plugins/netutils.c | |||
@@ -32,7 +32,6 @@ | |||
32 | #include "common.h" | 32 | #include "common.h" |
33 | #include "netutils.h" | 33 | #include "netutils.h" |
34 | 34 | ||
35 | unsigned int socket_timeout = DEFAULT_SOCKET_TIMEOUT; | ||
36 | int econn_refuse_state = STATE_CRITICAL; | 35 | int econn_refuse_state = STATE_CRITICAL; |
37 | int was_refused = FALSE; | 36 | int was_refused = FALSE; |
38 | #if USE_IPV6 | 37 | #if USE_IPV6 |
@@ -46,11 +45,11 @@ void | |||
46 | socket_timeout_alarm_handler (int sig) | 45 | socket_timeout_alarm_handler (int sig) |
47 | { | 46 | { |
48 | if (sig == SIGALRM) | 47 | if (sig == SIGALRM) |
49 | printf (_("CRITICAL - Socket timeout after %d seconds\n"), socket_timeout); | 48 | printf (_("%s - Socket timeout after %d seconds\n"), state_text(socket_timeout_state), socket_timeout); |
50 | else | 49 | else |
51 | printf (_("CRITICAL - Abnormal timeout after %d seconds\n"), socket_timeout); | 50 | printf (_("%s - Abnormal timeout after %d seconds\n"), state_text(socket_timeout_state), socket_timeout); |
52 | 51 | ||
53 | exit (STATE_CRITICAL); | 52 | exit (socket_timeout_state); |
54 | } | 53 | } |
55 | 54 | ||
56 | 55 | ||