From 043aa641ad4373e96fd748deb1e7fab3cb579a07 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 09:46:09 +0200 Subject: Merging upstream version 2.1.7. Signed-off-by: Daniel Baumann --- agents/ocf/HealthCPU.in | 23 +++++++++++++++++------ agents/ocf/HealthSMART.in | 16 ++++++++-------- agents/ocf/Makefile.am | 11 ++++++++--- agents/ocf/ifspeed.in | 20 ++++++++++++-------- agents/ocf/ping.in | 13 ++++--------- 5 files changed, 49 insertions(+), 34 deletions(-) (limited to 'agents/ocf') diff --git a/agents/ocf/HealthCPU.in b/agents/ocf/HealthCPU.in index 4a8e7c3..14e4b07 100755 --- a/agents/ocf/HealthCPU.in +++ b/agents/ocf/HealthCPU.in @@ -67,6 +67,15 @@ the #health-cpu will go red if the %idle of the CPU falls below 10%. + + +The time to wait (dampening) in seconds for further changes before writing + +The time to wait (dampening) in seconds for further changes +before writing + + + @@ -117,16 +126,16 @@ healthcpu_monitor() { if [ $IDLE -lt ${OCF_RESKEY_red_limit} ] ; then # echo "System state RED!" - attrd_updater -n "#health-cpu" -U "red" -d "30s" + attrd_updater -n "#health-cpu" -B "red" -d "${OCF_RESKEY_dampening}" return $OCF_SUCCESS fi if [ $IDLE -lt ${OCF_RESKEY_yellow_limit} ] ; then # echo "System state yellow." - attrd_updater -n "#health-cpu" -U "yellow" -d "30s" + attrd_updater -n "#health-cpu" -B "yellow" -d "${OCF_RESKEY_dampening}" else # echo "System state green." - attrd_updater -n "#health-cpu" -U "green" -d "30s" + attrd_updater -n "#health-cpu" -B "green" -d "${OCF_RESKEY_dampening}" fi return $OCF_SUCCESS @@ -136,8 +145,7 @@ healthcpu_monitor() { } healthcpu_reload_agent() { - # No action required - :; + return $OCF_SUCCESS } healthcpu_validate() { @@ -188,6 +196,9 @@ fi if [ -z "${OCF_RESKEY_yellow_limit}" ] ; then OCF_RESKEY_yellow_limit=50 fi +if [ -z "${OCF_RESKEY_dampening}" ]; then + OCF_RESKEY_dampening="30s" +fi case "$__OCF_ACTION" in meta-data) meta_data @@ -195,7 +206,7 @@ meta-data) meta_data ;; start) healthcpu_start;; stop) healthcpu_stop;; -monitor) healthcpu_monitor;; +monitor) healthcpu_validate && healthcpu_monitor;; reload-agent) healthcpu_reload_agent;; validate-all) healthcpu_validate;; usage|help) healthcpu_usage diff --git a/agents/ocf/HealthSMART.in b/agents/ocf/HealthSMART.in index b6edac2..b2f37de 100755 --- a/agents/ocf/HealthSMART.in +++ b/agents/ocf/HealthSMART.in @@ -139,25 +139,25 @@ check_temperature() { if [ $1 -lt ${lower_red_limit} ] ; then ocf_log info "Drive ${DRIVE} ${DEVICE} too cold: ${1} C" - attrd_updater -n "#health-smart" -U "red" -d "${OCF_RESKEY_dampen}" + attrd_updater -n "#health-smart" -B "red" -d "${OCF_RESKEY_dampen}" return 1 fi if [ $1 -gt ${upper_red_limit} ] ; then ocf_log info "Drive ${DRIVE} ${DEVICE} too hot: ${1} C" - attrd_updater -n "#health-smart" -U "red" -d "${OCF_RESKEY_dampen}" + attrd_updater -n "#health-smart" -B "red" -d "${OCF_RESKEY_dampen}" return 1 fi if [ $1 -lt ${lower_yellow_limit} ] ; then ocf_log info "Drive ${DRIVE} ${DEVICE} quite cold: ${1} C" - attrd_updater -n "#health-smart" -U "yellow" -d "${OCF_RESKEY_dampen}" + attrd_updater -n "#health-smart" -B "yellow" -d "${OCF_RESKEY_dampen}" return 1 fi if [ $1 -gt ${upper_yellow_limit} ] ; then ocf_log info "Drive ${DRIVE} ${DEVICE} quite hot: ${1} C" - attrd_updater -n "#health-smart" -U "yellow" -d "${OCF_RESKEY_dampen}" + attrd_updater -n "#health-smart" -B "yellow" -d "${OCF_RESKEY_dampen}" return 1 fi } @@ -244,7 +244,7 @@ HealthSMART_start() { } HealthSMART_stop() { - attrd_updater -D -n "#health-smart" -d "${OCF_RESKEY_dampen}" + attrd_updater -D -n "#health-smart" rm "${OCF_RESKEY_state}" @@ -278,7 +278,7 @@ HealthSMART_monitor() { # Check overall S.M.A.R.T. status "${OCF_RESKEY_smartctl}" -d "${DEVICE}" -H ${DRIVE} | grep -q "SMART overall-health self-assessment test result: PASSED" if [ $? -ne 0 ]; then - attrd_updater -n "#health-smart" -U "red" -d "${OCF_RESKEY_dampen}" + attrd_updater -n "#health-smart" -B "red" -d "${OCF_RESKEY_dampen}" return $OCF_SUCCESS fi @@ -290,7 +290,7 @@ HealthSMART_monitor() { else "${OCF_RESKEY_smartctl}" -H "${DRIVE}" | grep -q "SMART overall-health self-assessment test result: PASSED" if [ $? -ne 0 ]; then - attrd_updater -n "#health-smart" -U "red" -d "${OCF_RESKEY_dampen}" + attrd_updater -n "#health-smart" -B "red" -d "${OCF_RESKEY_dampen}" return $OCF_SUCCESS fi @@ -301,7 +301,7 @@ HealthSMART_monitor() { fi done - attrd_updater -n "#health-smart" -U "green" -d "${OCF_RESKEY_dampen}" + attrd_updater -n "#health-smart" -B "green" -d "${OCF_RESKEY_dampen}" return $OCF_SUCCESS fi diff --git a/agents/ocf/Makefile.am b/agents/ocf/Makefile.am index 823e67e..0b18bb1 100644 --- a/agents/ocf/Makefile.am +++ b/agents/ocf/Makefile.am @@ -27,8 +27,11 @@ ocf_SCRIPTS = ClusterMon \ if BUILD_XML_HELP -man7_MANS = $(ocf_SCRIPTS:%=ocf_pacemaker_%.7) $(dist_ocf_SCRIPTS:%=ocf_pacemaker_%.7) -DBOOK_OPTS = --stringparam command.prefix ocf_pacemaker_ --stringparam variable.prefix OCF_RESKEY_ --param man.vol 7 +man7_MANS = $(ocf_SCRIPTS:%=ocf_pacemaker_%.7) \ + $(dist_ocf_SCRIPTS:%=ocf_pacemaker_%.7) +DBOOK_OPTS = --stringparam command.prefix ocf_pacemaker_ \ + --stringparam variable.prefix OCF_RESKEY_ \ + --param man.vol 7 ocf_pacemaker_%.xml: % $(AM_V_GEN)OCF_FUNCTIONS=/dev/null OCF_ROOT=$(OCF_ROOT_DIR) $(abs_builddir)/$< meta-data > $@ @@ -50,4 +53,6 @@ validate: all | xmllint --noout --relaxng $(RNG) - || break; \ done -CLEANFILES = $(man7_MANS) $(ocf_SCRIPTS:%=%.xml) $(dist_ocf_SCRIPTS:%=%.xml) +CLEANFILES = $(man7_MANS) \ + $(ocf_SCRIPTS:%=%.xml) \ + $(dist_ocf_SCRIPTS:%=%.xml) diff --git a/agents/ocf/ifspeed.in b/agents/ocf/ifspeed.in index 5fbaf89..8c07c3d 100755 --- a/agents/ocf/ifspeed.in +++ b/agents/ocf/ifspeed.in @@ -123,7 +123,7 @@ Can be used to tune how big attribute value will be. - + The time to wait (dampening) for further changes to occur. @@ -147,6 +147,7 @@ Log more verbosely. + END @@ -154,7 +155,7 @@ END usage() { cat <