summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4142e17)
raw | patch | inline | side by side (parent: 4142e17)
author | Thomas Guyot-Sionnest <dermoth@aei.ca> | |
Fri, 20 Mar 2009 06:19:42 +0000 (02:19 -0400) | ||
committer | Thomas Guyot-Sionnest <dermoth@aei.ca> | |
Fri, 20 Mar 2009 06:19:42 +0000 (02:19 -0400) |
plugins/utils.c | patch | blob | history | |
plugins/utils.h | patch | blob | history |
diff --git a/plugins/utils.c b/plugins/utils.c
index 1900ef8601574e9e61970fcf286f07a497c200c3..45373909560552b462ccbb11ecdcc51c1a7a2ca8 100644 (file)
--- a/plugins/utils.c
+++ b/plugins/utils.c
timeout_alarm_handler (int signo)
{
if (signo == SIGALRM) {
- printf (_("CRITICAL - Plugin timed out after %d seconds\n"),
- timeout_interval);
- exit (STATE_CRITICAL);
+ printf (_("%s - Plugin timed out after %d seconds\n"),
+ state_text(timeout_state), timeout_interval);
+ exit (timeout_state);
}
}
diff --git a/plugins/utils.h b/plugins/utils.h
index 65e06ebd3793c567add534f5a61885c8090f2ec2..d6e9c8f7211149d46e821686953b9fea672f5ad0 100644 (file)
--- a/plugins/utils.h
+++ b/plugins/utils.h
/* Handle timeouts */
#ifdef LOCAL_TIMEOUT_ALARM_HANDLER
+extern unsigned int timeout_state;
extern unsigned int timeout_interval;
RETSIGTYPE timeout_alarm_handler (int);
#else
+unsigned int timeout_state = STATE_CRITICAL;
unsigned int timeout_interval = DEFAULT_SOCKET_TIMEOUT;
extern RETSIGTYPE timeout_alarm_handler (int);
#endif