[Nagios-checkins] nagios/base checks.c,1.132,1.133
Nagios network monitoring software is enterprise server monitoring
Brought to you by:
egalstad,
sawolf-nagios
From: Ethan G. <ega...@us...> - 2007-08-04 23:13:20
|
Update of /cvsroot/nagios/nagios/base In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv18390/base Modified Files: checks.c Log Message: Improved host check logic (more caching and parallelism), sample config file fixes Index: checks.c =================================================================== RCS file: /cvsroot/nagios/nagios/base/checks.c,v retrieving revision 1.132 retrieving revision 1.133 diff -C2 -d -r1.132 -r1.133 *** checks.c 16 Jul 2007 15:29:24 -0000 1.132 --- checks.c 4 Aug 2007 23:13:18 -0000 1.133 *************** *** 4,8 **** * * Copyright (c) 1999-2007 Ethan Galstad (na...@na...) ! * Last Modified: 07-16-2007 * * License: --- 4,8 ---- * * Copyright (c) 1999-2007 Ethan Galstad (na...@na...) ! * Last Modified: 08-04-2007 * * License: *************** *** 989,994 **** /* if the host has never been checked before... */ /* verify the host status */ ! if(temp_host->has_been_checked==FALSE) ! perform_on_demand_host_check(temp_host,NULL,CHECK_OPTION_NONE,TRUE,cached_host_check_horizon); } --- 989,1002 ---- /* if the host has never been checked before... */ /* verify the host status */ ! if(temp_host->has_been_checked==FALSE){ ! ! /* 08/04/07 EG launch an async (parallel) host check unless aggressive host checking is enabled */ ! /* previous logic was to simply run a sync (serial) host check */ ! if(use_aggressive_host_checking==TRUE) ! perform_on_demand_host_check(temp_host,NULL,CHECK_OPTION_NONE,TRUE,cached_host_check_horizon); ! else ! /* do NOT allow cached check results to happen here - we need the host to be checked for real... */ ! run_async_host_check_3x(temp_host,CHECK_OPTION_NONE,0.0,FALSE,FALSE,NULL,NULL); ! } } *************** *** 1096,1101 **** /* verify the route to the host and send out host recovery notifications */ ! if(temp_host->current_state!=HOST_UP) ! perform_on_demand_host_check(temp_host,NULL,CHECK_OPTION_NONE,TRUE,cached_host_check_horizon); /* if a hard service recovery has occurred... */ --- 1104,1128 ---- /* verify the route to the host and send out host recovery notifications */ ! if(temp_host->current_state!=HOST_UP){ ! ! log_debug_info(DEBUGL_CHECKS,1,"Host is NOT UP, so we'll check it to see if it recovered...\n"); ! ! /* 08/04/07 EG launch an async (parallel) host check (possibly cached) unless aggressive host checking is enabled */ ! /* previous logic was to simply run a sync (serial) host check */ ! if(use_aggressive_host_checking==TRUE) ! perform_on_demand_host_check(temp_host,NULL,CHECK_OPTION_NONE,TRUE,cached_host_check_horizon); ! else{ ! /* can we use the last cached host state? */ ! /* only use cached host state if no service state change has occurred */ ! if(state_change==FALSE && temp_host->has_been_checked==TRUE && ((current_time-temp_host->last_check) <= cached_host_check_horizon)){ ! log_debug_info(DEBUGL_CHECKS,1,"* Using cached host state: %d\n",temp_host->current_state); ! update_check_stats(ACTIVE_CACHED_HOST_CHECK_STATS,current_time); ! } ! ! /* else launch an async (parallel) check of the host */ ! else ! run_async_host_check_3x(temp_host,CHECK_OPTION_NONE,0.0,FALSE,FALSE,NULL,NULL); ! } ! } /* if a hard service recovery has occurred... */ *************** *** 1172,1179 **** log_debug_info(DEBUGL_CHECKS,1,"Service is in a non-OK state!\n"); ! /* check the route to the host if its supposed to be up right now... */ if(temp_host->current_state==HOST_UP){ ! log_debug_info(DEBUGL_CHECKS,1,"Host is currently UP, so recheck its state to make sure...\n"); ! perform_on_demand_host_check(temp_host,&route_result,CHECK_OPTION_NONE,TRUE,cached_host_check_horizon); } --- 1199,1228 ---- log_debug_info(DEBUGL_CHECKS,1,"Service is in a non-OK state!\n"); ! /* check the route to the host if its up right now... */ if(temp_host->current_state==HOST_UP){ ! ! log_debug_info(DEBUGL_CHECKS,1,"Host is currently UP, so we'll recheck its state to make sure...\n"); ! ! /* 08/04/07 EG launch an async (parallel) host check (possibly cached) unless aggressive host checking is enabled */ ! /* previous logic was to simply run a sync (serial) host check */ ! if(use_aggressive_host_checking==TRUE) ! perform_on_demand_host_check(temp_host,&route_result,CHECK_OPTION_NONE,TRUE,cached_host_check_horizon); ! else{ ! /* can we use the last cached host state? */ ! /* only use cached host state if no service state change has occurred */ ! if(state_change==FALSE && temp_host->has_been_checked==TRUE && ((current_time-temp_host->last_check) <= cached_host_check_horizon)){ ! /* use current host state as route result */ ! route_result=temp_host->current_state; ! log_debug_info(DEBUGL_CHECKS,1,"* Using cached host state: %d\n",temp_host->current_state); ! update_check_stats(ACTIVE_CACHED_HOST_CHECK_STATS,current_time); ! } ! ! /* else launch an async (parallel) check of the host */ ! else{ ! /* use current host state as route result */ ! route_result=temp_host->current_state; ! run_async_host_check_3x(temp_host,CHECK_OPTION_NONE,0.0,FALSE,FALSE,NULL,NULL); ! } ! } } *************** *** 1192,1196 **** else if(state_change==TRUE && temp_service->last_hard_state!=STATE_OK){ log_debug_info(DEBUGL_CHECKS,1,"Service wobbled between non-OK states, so we'll recheck the host state...\n"); ! perform_on_demand_host_check(temp_host,&route_result,CHECK_OPTION_NONE,TRUE,cached_host_check_horizon); } --- 1241,1250 ---- else if(state_change==TRUE && temp_service->last_hard_state!=STATE_OK){ log_debug_info(DEBUGL_CHECKS,1,"Service wobbled between non-OK states, so we'll recheck the host state...\n"); ! /* 08/04/07 EG launch an async (parallel) host check unless aggressive host checking is enabled */ ! /* previous logic was to simply run a sync (serial) host check */ ! /* use current host state as route result */ ! route_result=temp_host->current_state; ! run_async_host_check_3x(temp_host,CHECK_OPTION_NONE,0.0,FALSE,FALSE,NULL,NULL); ! /*perform_on_demand_host_check(temp_host,&route_result,CHECK_OPTION_NONE,TRUE,cached_host_check_horizon);*/ } |