diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:45:40 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:45:40 +0000 |
commit | 07d7f4cfa4b10de87a31b68191036ff446add675 (patch) | |
tree | 7162524d8aaf1aef62d2f4fa51f595ed113981ff /agents/ocf/HealthCPU.in | |
parent | Adding upstream version 2.1.6. (diff) | |
download | pacemaker-upstream/2.1.7.tar.xz pacemaker-upstream/2.1.7.zip |
Adding upstream version 2.1.7.upstream/2.1.7
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'agents/ocf/HealthCPU.in')
-rwxr-xr-x | agents/ocf/HealthCPU.in | 23 |
1 files changed, 17 insertions, 6 deletions
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%. <content type="string" default="10"/> </parameter> +<parameter name="dampening" reloadable="1"> +<longdesc lang="en"> +The time to wait (dampening) in seconds for further changes before writing +</longdesc> +<shortdesc lang="en">The time to wait (dampening) in seconds for further changes +before writing</shortdesc> +<content type="string" default="30s"/> +</parameter> + </parameters> <actions> @@ -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 |