From 0a5fb8acb9eca15d4ea237b21da533f45821c099 Mon Sep 17 00:00:00 2001 From: rpm-build Date: Thu, 7 Dec 2023 06:54:56 +0800 Subject: [PATCH] Modify HealthCPU HealthIOWait HealthSmart about dampen, reload, and validate simultaneously --- agents/ocf/HealthCPU.in | 13 +++++-------- agents/ocf/HealthIOWait.in | 19 +++++++++++-------- agents/ocf/HealthSMART.in | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/agents/ocf/HealthCPU.in b/agents/ocf/HealthCPU.in index 4bd6e36..6e9745d 100755 --- a/agents/ocf/HealthCPU.in +++ b/agents/ocf/HealthCPU.in @@ -26,6 +26,7 @@ : ${OCF_FUNCTIONS:="${OCF_ROOT}/resource.d/heartbeat/.ocf-shellfuncs"} . "${OCF_FUNCTIONS}" : ${__OCF_ACTION:="$1"} +: ${OCF_RESKEY_dampen:="30s"} ####################################################################### @@ -126,16 +127,16 @@ healthcpu_monitor() { if [ $IDLE -lt ${OCF_RESKEY_red_limit} ] ; then # echo "System state RED!" - attrd_updater -n "#health-cpu" -B "red" -d ${OCF_RESKEY_dampening} + 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" -B "yellow" -d ${OCF_RESKEY_dampening} + attrd_updater -n "#health-cpu" -B "yellow" -d "${OCF_RESKEY_dampening}" else # echo "System state green." - attrd_updater -n "#health-cpu" -B "green" -d ${OCF_RESKEY_dampening} + attrd_updater -n "#health-cpu" -B "green" -d "${OCF_RESKEY_dampening}" fi return $OCF_SUCCESS @@ -145,8 +146,7 @@ healthcpu_monitor() { } healthcpu_reload_agent() { - # No action required - :; + return $OCF_SUCCESS } healthcpu_validate() { @@ -197,9 +197,6 @@ 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 diff --git a/agents/ocf/HealthIOWait.in b/agents/ocf/HealthIOWait.in index 61b6de3..65ce901 100755 --- a/agents/ocf/HealthIOWait.in +++ b/agents/ocf/HealthIOWait.in @@ -19,6 +19,7 @@ : ${OCF_FUNCTIONS:="${OCF_ROOT}/resource.d/heartbeat/.ocf-shellfuncs"} . "${OCF_FUNCTIONS}" : ${__OCF_ACTION:="$1"} +: ${OCF_RESKEY_dampening:="5s"} ####################################################################### @@ -75,6 +76,7 @@ before writing + @@ -86,7 +88,7 @@ END agent_usage() { cat <