Skip to content

Commit

Permalink
Patch from Dave Love <[email protected]> to fix SGE load sensor
Browse files Browse the repository at this point in the history
mode so that each run through the loop does a fresh check of system
health.  Otherwise, things like process information, filesystem
status, etc. won't be refreshed, and the cached (i.e., stale) data
from the first time through the loop will be used indefinitely!  This
also allows updating/modifying the NHC check modules in /etc/nhc/*.nhc
without having to restart the load sensor.
  • Loading branch information
Michael Jennings committed Nov 8, 2014
1 parent 9bb5126 commit 642c420
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion nhc
Original file line number Diff line number Diff line change
Expand Up @@ -593,18 +593,23 @@ nhcmain_load_sysconfig
nhcmain_finalize_env
nhcmain_redirect_output
nhcmain_check_conffile || exit 0
nhcmain_load_scripts
if [[ "$NHC_RM" == "sge" ]]; then
while : ; do
read INPUT
if [[ $? != 0 || "$INPUT" == "quit" ]]; then
exit 0
fi
# We need to do this each time to flush the caches which the
# scripts mostly keep (filesystems, process trees, etc.).
# Also the scripts can be changed without having to kill the
# sensor on all the hosts to pick that up.
nhcmain_load_scripts
if nhcmain_run_checks ; then
nhcmain_finish
fi
done
else
nhcmain_load_scripts
nhcmain_set_watchdog
nhcmain_run_checks
nhcmain_mark_online
Expand Down

0 comments on commit 642c420

Please sign in to comment.