[Nagiosplug-checkins] SF.net SVN: nagiosplug:[2177] nagiosplug/trunk/plugins

dermoth at users.sourceforge.net dermoth at users.sourceforge.net
Fri Mar 20 07:29:26 CET 2009


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 <dermoth at aei.ca>

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.




More information about the Commits mailing list