!41 [sync] PR-39: Add the parameter of attrd_delay and fix attrd_updter command for HealthIOWait

From: @openeuler-sync-bot 
Reviewed-by: @jxy_git 
Signed-off-by: @jxy_git
This commit is contained in:
openeuler-ci-bot 2023-08-28 01:16:18 +00:00 committed by Gitee
commit 85b841c43b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 68 additions and 1 deletions

View File

@ -0,0 +1,63 @@
From 30271f16c9878a03b803d2f1e6b5b5ec214a6365 Mon Sep 17 00:00:00 2001
From: liupei <liupei@kylinos.cn>
Date: Wed, 23 Aug 2023 19:02:10 +0800
Subject: [PATCH] Add the parameter of dampening and fix attrd_updater command
---
agents/ocf/HealthIOWait.in | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/agents/ocf/HealthIOWait.in b/agents/ocf/HealthIOWait.in
index ba7a17a..de2844b 100644
--- a/agents/ocf/HealthIOWait.in
+++ b/agents/ocf/HealthIOWait.in
@@ -60,6 +60,15 @@ the #health-iowait will go red if the %iowait of the CPU get higher than 15%.
<content type="integer" default="15"/>
</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="5s"/>
+</parameter>
+
</parameters>
<actions>
@@ -109,16 +118,16 @@ agent_monitor() {
# echo $OCF_RESKEY_yellow_limit
if [ $WAIT -gt ${OCF_RESKEY_red_limit} ] ; then
# echo "System state RED!"
- attrd_updater -n "#health-iowait" -U "red" -d "5s"
+ attrd_updater -n "#health-iowait" -B "red" -d ${OCF_RESKEY_dampening}
return $OCF_SUCCESS
fi
if [ $WAIT -gt ${OCF_RESKEY_yellow_limit} ] ; then
# echo "System state yellow."
- attrd_updater -n "#health-iowait" -U "yellow" -d "5s"
+ attrd_updater -n "#health-iowait" -B "yellow" -d ${OCF_RESKEY_dampening}
else
# echo "System state green."
- attrd_updater -n "#health-iowait" -U "green" -d "5s"
+ attrd_updater -n "#health-iowait" -B "green" -d ${OCF_RESKEY_dampening}
fi
return $OCF_SUCCESS
fi
@@ -175,6 +184,10 @@ if [ -z "${OCF_RESKEY_yellow_limit}" ] ; then
OCF_RESKEY_yellow_limit=10
fi
+if [ -z "${OCF_RESKEY_dampening}" ]; then
+ OCF_RESKEY_dampening="5s"
+fi
+
case $__OCF_ACTION in
meta-data) meta_data
exit $OCF_SUCCESS
--
2.33.1.windows.1

View File

@ -17,7 +17,7 @@
## can be incremented to build packages reliably considered "newer"
## than previously built packages with the same pcmkversion)
%global pcmkversion 2.1.6
%global specversion 3
%global specversion 4
## Upstream commit (full commit ID, abbreviated commit ID, or tag) to build
%global commit 6fdc9deea294bbad629b003c6ae036aaed8e3ee0
@ -153,6 +153,7 @@ Source1: https://codeload.github.com/%{github_owner}/%{nagios_name}/tar.gz
# https://github.com/ClusterLabs/pacemaker/pull/3177
Patch0: 0001-Fix-glib-assertions.patch
Patch1: 0001-Add-the-parameter-of-dampening-and-fix-attrd_updater.patch
Patch2: 0001-Add-the-parameter-of-dampening-and-fix-attrd_updater-HealthIOWait.patch
# upstream commits
@ -773,6 +774,9 @@ exit 0
%license %{nagios_name}-%{nagios_hash}/COPYING
%changelog
* Wed Aug 23 2023 liupei <liupei@kylinos.cn> - 2.1.6-4
- Add the parameter of attrd_delay and fix attrd_updter command for HealthIOWait
* Wed Aug 23 2023 liupei <liupei@kylinos.cn> - 2.1.6-3
- Add the parameter of attrd_delay and fix attrd_updter command