Revision: 2177
http://nagiosplug.svn.sourceforge.net/nagiosplug/?rev=2177&view=rev
Author: dermoth
Date: 2009-03-20 06:29:25 +0000 (Fri, 20 Mar 2009)
Log Message:
-----------
Make alarm handler customisable
From: Thomas Guyot-Sionnest <[email protected]>
Modified Paths:
--------------
nagiosplug/trunk/plugins/utils.c
nagiosplug/trunk/plugins/utils.h
Modified: nagiosplug/trunk/plugins/utils.c
===================================================================
--- nagiosplug/trunk/plugins/utils.c 2009-03-20 06:29:12 UTC (rev 2176)
+++ nagiosplug/trunk/plugins/utils.c 2009-03-20 06:29:25 UTC (rev 2177)
@@ -168,9 +168,9 @@
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);
}
}
Modified: nagiosplug/trunk/plugins/utils.h
===================================================================
--- nagiosplug/trunk/plugins/utils.h 2009-03-20 06:29:12 UTC (rev 2176)
+++ nagiosplug/trunk/plugins/utils.h 2009-03-20 06:29:25 UTC (rev 2177)
@@ -32,9 +32,11 @@
/* 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
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.