Skip to content

Commit 642c420

Browse files
author
Michael Jennings
committed
Patch from Dave Love <d.love@liverpool.ac.uk> to fix SGE load sensor
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.
1 parent 9bb5126 commit 642c420

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: nhc

+6-1
Original file line numberDiff line numberDiff line change
@@ -593,18 +593,23 @@ nhcmain_load_sysconfig
593593
nhcmain_finalize_env
594594
nhcmain_redirect_output
595595
nhcmain_check_conffile || exit 0
596-
nhcmain_load_scripts
597596
if [[ "$NHC_RM" == "sge" ]]; then
598597
while : ; do
599598
read INPUT
600599
if [[ $? != 0 || "$INPUT" == "quit" ]]; then
601600
exit 0
602601
fi
602+
# We need to do this each time to flush the caches which the
603+
# scripts mostly keep (filesystems, process trees, etc.).
604+
# Also the scripts can be changed without having to kill the
605+
# sensor on all the hosts to pick that up.
606+
nhcmain_load_scripts
603607
if nhcmain_run_checks ; then
604608
nhcmain_finish
605609
fi
606610
done
607611
else
612+
nhcmain_load_scripts
608613
nhcmain_set_watchdog
609614
nhcmain_run_checks
610615
nhcmain_mark_online

0 commit comments

Comments
 (0)