[Nagios-checkins] SF.net SVN: nagios:[2061] nagioscore/trunk

ageric at users.sourceforge.net ageric at users.sourceforge.net
Mon Aug 13 15:18:00 UTC 2012


Revision: 2061
          http://nagios.svn.sourceforge.net/nagios/?rev=2061&view=rev
Author:   ageric
Date:     2012-08-13 15:17:59 +0000 (Mon, 13 Aug 2012)
Log Message:
-----------
core: Remove and obsolete sleep_time

We're event-driven now, which means we'll always sleep when there's
nothing to do, and never sleep when there's work to do. Since we're
also far more effective than earlier, even quite large configs are
far from making Nagios reach 10% cpu usage.

Signed-off-by: Andreas Ericsson <ae at op5.se>

Modified Paths:
--------------
    nagioscore/trunk/base/config.c
    nagioscore/trunk/base/events.c
    nagioscore/trunk/base/nagios.c
    nagioscore/trunk/base/utils.c
    nagioscore/trunk/include/nagios.h
    nagioscore/trunk/sample-config/nagios.cfg.in
    nagioscore/trunk/t/etc/nagios-empty-groups.cfg
    nagioscore/trunk/t/etc/nagios-hosturgencies.cfg
    nagioscore/trunk/t/etc/nagios-no-contactgroup.cfg
    nagioscore/trunk/t/etc/nagios-no-service.cfg
    nagioscore/trunk/t/etc/nagios-no-status.cfg
    nagioscore/trunk/t/etc/nagios-with-generated-status.cfg
    nagioscore/trunk/t/etc/nagios.cfg
    nagioscore/trunk/t-tap/smallconfig/nagios.cfg
    nagioscore/trunk/t-tap/test-stubs.c
    nagioscore/trunk/t-tap/test_events.c
    nagioscore/trunk/t-tap/test_nagios_config.c
    nagioscore/trunk/t-tap/test_timeperiods.c

Modified: nagioscore/trunk/base/config.c
===================================================================
--- nagioscore/trunk/base/config.c	2012-08-13 15:17:09 UTC (rev 2060)
+++ nagioscore/trunk/base/config.c	2012-08-13 15:17:59 UTC (rev 2061)
@@ -89,7 +89,6 @@
 extern int      precache_objects;
 extern int      use_precached_objects;
 
-extern double   sleep_time;
 extern int      interval_length;
 extern int      service_inter_check_delay_method;
 extern int      host_inter_check_delay_method;
@@ -979,13 +978,7 @@
 			}
 
 		else if(!strcmp(variable, "sleep_time")) {
-
-			sleep_time = atof(value);
-			if(sleep_time <= 0.0) {
-				asprintf(&error_message, "Illegal value for sleep_time");
-				error = TRUE;
-				break;
-				}
+			obsoleted_warning(variable, NULL);
 			}
 
 		else if(!strcmp(variable, "interval_length")) {

Modified: nagioscore/trunk/base/events.c
===================================================================
--- nagioscore/trunk/base/events.c	2012-08-13 15:17:09 UTC (rev 2060)
+++ nagioscore/trunk/base/events.c	2012-08-13 15:17:59 UTC (rev 2061)
@@ -43,7 +43,6 @@
 extern int      sigshutdown;
 extern int      sigrestart;
 
-extern double   sleep_time;
 extern int      interval_length;
 extern int      service_inter_check_delay_method;
 extern int      host_inter_check_delay_method;

Modified: nagioscore/trunk/base/nagios.c
===================================================================
--- nagioscore/trunk/base/nagios.c	2012-08-13 15:17:09 UTC (rev 2060)
+++ nagioscore/trunk/base/nagios.c	2012-08-13 15:17:59 UTC (rev 2061)
@@ -104,7 +104,6 @@
 int             ocsp_timeout = DEFAULT_OCSP_TIMEOUT;
 int             ochp_timeout = DEFAULT_OCHP_TIMEOUT;
 
-double          sleep_time = DEFAULT_SLEEP_TIME;
 int             interval_length = DEFAULT_INTERVAL_LENGTH;
 int             service_inter_check_delay_method = ICD_SMART;
 int             host_inter_check_delay_method = ICD_SMART;

Modified: nagioscore/trunk/base/utils.c
===================================================================
--- nagioscore/trunk/base/utils.c	2012-08-13 15:17:09 UTC (rev 2060)
+++ nagioscore/trunk/base/utils.c	2012-08-13 15:17:59 UTC (rev 2061)
@@ -110,7 +110,6 @@
 
 extern int      log_initial_states;
 
-extern double   sleep_time;
 extern int      interval_length;
 extern int      service_inter_check_delay_method;
 extern int      host_inter_check_delay_method;
@@ -3464,7 +3463,6 @@
 	ocsp_timeout = DEFAULT_OCSP_TIMEOUT;
 	ochp_timeout = DEFAULT_OCHP_TIMEOUT;
 
-	sleep_time = DEFAULT_SLEEP_TIME;
 	interval_length = DEFAULT_INTERVAL_LENGTH;
 	service_inter_check_delay_method = ICD_SMART;
 	host_inter_check_delay_method = ICD_SMART;

Modified: nagioscore/trunk/include/nagios.h
===================================================================
--- nagioscore/trunk/include/nagios.h	2012-08-13 15:17:09 UTC (rev 2060)
+++ nagioscore/trunk/include/nagios.h	2012-08-13 15:17:59 UTC (rev 2061)
@@ -58,7 +58,6 @@
 
 #define DEFAULT_INTER_CHECK_DELAY				5.0	/* seconds between initial service check scheduling */
 #define DEFAULT_INTERLEAVE_FACTOR      				1       /* default interleave to use when scheduling checks */
-#define DEFAULT_SLEEP_TIME      				0.5    	/* seconds between event run checks */
 #define DEFAULT_INTERVAL_LENGTH 				60     	/* seconds per interval unit for check scheduling */
 #define DEFAULT_RETRY_INTERVAL  				30	/* services are retried in 30 seconds if they're not OK */
 #define DEFAULT_CHECK_REAPER_INTERVAL				10	/* interval in seconds to reap host and service check results */

Modified: nagioscore/trunk/sample-config/nagios.cfg.in
===================================================================
--- nagioscore/trunk/sample-config/nagios.cfg.in	2012-08-13 15:17:09 UTC (rev 2060)
+++ nagioscore/trunk/sample-config/nagios.cfg.in	2012-08-13 15:17:59 UTC (rev 2061)
@@ -561,14 +561,6 @@
 
 
 
-# SLEEP TIME
-# This is the number of seconds to sleep between checking for system
-# events and service checks that need to be run.
-
-sleep_time=0.25
-
-
-
 # TIMEOUT VALUES
 # These options control how much time Nagios will allow various
 # types of commands to execute before killing them off.  Options

Modified: nagioscore/trunk/t/etc/nagios-empty-groups.cfg
===================================================================
--- nagioscore/trunk/t/etc/nagios-empty-groups.cfg	2012-08-13 15:17:09 UTC (rev 2060)
+++ nagioscore/trunk/t/etc/nagios-empty-groups.cfg	2012-08-13 15:17:59 UTC (rev 2061)
@@ -547,14 +547,6 @@
 
 
 
-# SLEEP TIME
-# This is the number of seconds to sleep between checking for system
-# events and service checks that need to be run.
-
-sleep_time=0.25
-
-
-
 # TIMEOUT VALUES
 # These options control how much time Nagios will allow various
 # types of commands to execute before killing them off.  Options

Modified: nagioscore/trunk/t/etc/nagios-hosturgencies.cfg
===================================================================
--- nagioscore/trunk/t/etc/nagios-hosturgencies.cfg	2012-08-13 15:17:09 UTC (rev 2060)
+++ nagioscore/trunk/t/etc/nagios-hosturgencies.cfg	2012-08-13 15:17:59 UTC (rev 2061)
@@ -547,14 +547,6 @@
 
 
 
-# SLEEP TIME
-# This is the number of seconds to sleep between checking for system
-# events and service checks that need to be run.
-
-sleep_time=0.25
-
-
-
 # TIMEOUT VALUES
 # These options control how much time Nagios will allow various
 # types of commands to execute before killing them off.  Options

Modified: nagioscore/trunk/t/etc/nagios-no-contactgroup.cfg
===================================================================
--- nagioscore/trunk/t/etc/nagios-no-contactgroup.cfg	2012-08-13 15:17:09 UTC (rev 2060)
+++ nagioscore/trunk/t/etc/nagios-no-contactgroup.cfg	2012-08-13 15:17:59 UTC (rev 2061)
@@ -547,14 +547,6 @@
 
 
 
-# SLEEP TIME
-# This is the number of seconds to sleep between checking for system
-# events and service checks that need to be run.
-
-sleep_time=0.25
-
-
-
 # TIMEOUT VALUES
 # These options control how much time Nagios will allow various
 # types of commands to execute before killing them off.  Options

Modified: nagioscore/trunk/t/etc/nagios-no-service.cfg
===================================================================
--- nagioscore/trunk/t/etc/nagios-no-service.cfg	2012-08-13 15:17:09 UTC (rev 2060)
+++ nagioscore/trunk/t/etc/nagios-no-service.cfg	2012-08-13 15:17:59 UTC (rev 2061)
@@ -547,14 +547,6 @@
 
 
 
-# SLEEP TIME
-# This is the number of seconds to sleep between checking for system
-# events and service checks that need to be run.
-
-sleep_time=0.25
-
-
-
 # TIMEOUT VALUES
 # These options control how much time Nagios will allow various
 # types of commands to execute before killing them off.  Options

Modified: nagioscore/trunk/t/etc/nagios-no-status.cfg
===================================================================
--- nagioscore/trunk/t/etc/nagios-no-status.cfg	2012-08-13 15:17:09 UTC (rev 2060)
+++ nagioscore/trunk/t/etc/nagios-no-status.cfg	2012-08-13 15:17:59 UTC (rev 2061)
@@ -547,14 +547,6 @@
 
 
 
-# SLEEP TIME
-# This is the number of seconds to sleep between checking for system
-# events and service checks that need to be run.
-
-sleep_time=0.25
-
-
-
 # TIMEOUT VALUES
 # These options control how much time Nagios will allow various
 # types of commands to execute before killing them off.  Options

Modified: nagioscore/trunk/t/etc/nagios-with-generated-status.cfg
===================================================================
--- nagioscore/trunk/t/etc/nagios-with-generated-status.cfg	2012-08-13 15:17:09 UTC (rev 2060)
+++ nagioscore/trunk/t/etc/nagios-with-generated-status.cfg	2012-08-13 15:17:59 UTC (rev 2061)
@@ -547,14 +547,6 @@
 
 
 
-# SLEEP TIME
-# This is the number of seconds to sleep between checking for system
-# events and service checks that need to be run.
-
-sleep_time=0.25
-
-
-
 # TIMEOUT VALUES
 # These options control how much time Nagios will allow various
 # types of commands to execute before killing them off.  Options

Modified: nagioscore/trunk/t/etc/nagios.cfg
===================================================================
--- nagioscore/trunk/t/etc/nagios.cfg	2012-08-13 15:17:09 UTC (rev 2060)
+++ nagioscore/trunk/t/etc/nagios.cfg	2012-08-13 15:17:59 UTC (rev 2061)
@@ -547,14 +547,6 @@
 
 
 
-# SLEEP TIME
-# This is the number of seconds to sleep between checking for system
-# events and service checks that need to be run.
-
-sleep_time=0.25
-
-
-
 # TIMEOUT VALUES
 # These options control how much time Nagios will allow various
 # types of commands to execute before killing them off.  Options

Modified: nagioscore/trunk/t-tap/smallconfig/nagios.cfg
===================================================================
--- nagioscore/trunk/t-tap/smallconfig/nagios.cfg	2012-08-13 15:17:09 UTC (rev 2060)
+++ nagioscore/trunk/t-tap/smallconfig/nagios.cfg	2012-08-13 15:17:59 UTC (rev 2061)
@@ -547,14 +547,6 @@
 
 
 
-# SLEEP TIME
-# This is the number of seconds to sleep between checking for system
-# events and service checks that need to be run.
-
-sleep_time=0.25
-
-
-
 # TIMEOUT VALUES
 # These options control how much time Nagios will allow various
 # types of commands to execute before killing them off.  Options

Modified: nagioscore/trunk/t-tap/test-stubs.c
===================================================================
--- nagioscore/trunk/t-tap/test-stubs.c	2012-08-13 15:17:09 UTC (rev 2060)
+++ nagioscore/trunk/t-tap/test-stubs.c	2012-08-13 15:17:59 UTC (rev 2061)
@@ -12,7 +12,6 @@
 int      sigshutdown = FALSE;
 int      sigrestart = FALSE;
 
-double   sleep_time;
 int      interval_length = 60;
 int      service_inter_check_delay_method;
 int      host_inter_check_delay_method;

Modified: nagioscore/trunk/t-tap/test_events.c
===================================================================
--- nagioscore/trunk/t-tap/test_events.c	2012-08-13 15:17:09 UTC (rev 2060)
+++ nagioscore/trunk/t-tap/test_events.c	2012-08-13 15:17:59 UTC (rev 2061)
@@ -36,7 +36,6 @@
 int      sigshutdown = FALSE;
 int      sigrestart = FALSE;
 
-double   sleep_time;
 int      interval_length = 60;
 int      service_inter_check_delay_method;
 int      host_inter_check_delay_method;

Modified: nagioscore/trunk/t-tap/test_nagios_config.c
===================================================================
--- nagioscore/trunk/t-tap/test_nagios_config.c	2012-08-13 15:17:09 UTC (rev 2060)
+++ nagioscore/trunk/t-tap/test_nagios_config.c	2012-08-13 15:17:59 UTC (rev 2061)
@@ -94,7 +94,6 @@
 int             ocsp_timeout = DEFAULT_OCSP_TIMEOUT;
 int             ochp_timeout = DEFAULT_OCHP_TIMEOUT;
 
-double          sleep_time = DEFAULT_SLEEP_TIME;
 int             interval_length = DEFAULT_INTERVAL_LENGTH;
 int             service_inter_check_delay_method = ICD_SMART;
 int             host_inter_check_delay_method = ICD_SMART;

Modified: nagioscore/trunk/t-tap/test_timeperiods.c
===================================================================
--- nagioscore/trunk/t-tap/test_timeperiods.c	2012-08-13 15:17:09 UTC (rev 2060)
+++ nagioscore/trunk/t-tap/test_timeperiods.c	2012-08-13 15:17:59 UTC (rev 2061)
@@ -94,7 +94,6 @@
 int             ocsp_timeout = DEFAULT_OCSP_TIMEOUT;
 int             ochp_timeout = DEFAULT_OCHP_TIMEOUT;
 
-double          sleep_time = DEFAULT_SLEEP_TIME;
 int             interval_length = DEFAULT_INTERVAL_LENGTH;
 int             service_inter_check_delay_method = ICD_SMART;
 int             host_inter_check_delay_method = ICD_SMART;

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the Nagios-commits mailing list