diff options
Diffstat (limited to 'agents/ocf')
-rwxr-xr-x | agents/ocf/HealthCPU.in | 4 | ||||
-rwxr-xr-x | agents/ocf/HealthIOWait.in | 26 | ||||
-rwxr-xr-x | agents/ocf/HealthSMART.in | 46 | ||||
-rwxr-xr-x | agents/ocf/SysInfo.in | 6 | ||||
-rwxr-xr-x | agents/ocf/o2cb.in | 3 |
5 files changed, 52 insertions, 33 deletions
diff --git a/agents/ocf/HealthCPU.in b/agents/ocf/HealthCPU.in index 14e4b07..1a691a9 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_dampening:="30s"} ####################################################################### @@ -196,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 ba7a17a..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"} ####################################################################### @@ -60,12 +61,22 @@ 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> <action name="start" timeout="10s" /> <action name="stop" timeout="10s" /> <action name="monitor" timeout="10s" interval="10s" start-delay="0s" /> +<action name="reload-agent" timeout="20s" /> <action name="meta-data" timeout="5s" /> <action name="validate-all" timeout="10s" depth="0" /> </actions> @@ -77,7 +88,7 @@ END agent_usage() { cat <<END -usage: $0 {start|stop|monitor|validate-all|meta-data} +usage: $0 {start|stop|monitor|reload-agent|validate-all|meta-data} Expects to have a fully populated OCF RA-compliant environment set. END @@ -109,22 +120,26 @@ 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 return $OCF_NOT_RUNNING } +agent_reload_agent() { + return $OCF_SUCCESS +} + is_integer() { case "$1" in ""|*[0-9]*) return 0 ;; @@ -181,7 +196,8 @@ meta-data) meta_data ;; start) agent_start;; stop) agent_stop;; -monitor) agent_monitor;; +monitor) agent_validate && agent_monitor;; +reload-agent) agent_reload_agent;; validate-all) agent_validate;; usage|help) agent_usage exit $OCF_SUCCESS diff --git a/agents/ocf/HealthSMART.in b/agents/ocf/HealthSMART.in index b2f37de..f688f73 100755 --- a/agents/ocf/HealthSMART.in +++ b/agents/ocf/HealthSMART.in @@ -80,7 +80,7 @@ The device type(s) to assume for the drive(s) being tested as a SPACE separated <parameter name="temp_lower_limit" reloadable="1"> <longdesc lang="en"> -Lower limit of the temperature in deg C of the drive(s). Below this limit the status will be red. +Lower limit of the temperature in deg C of the drive(s). Below this limit the status of #health-smart will be red. </longdesc> <shortdesc lang="en">Lower limit for the red smart attribute</shortdesc> <content type="string" default="0"/> @@ -116,7 +116,7 @@ The path to the smartctl program, used for querying device health. The time to wait (dampening) for further changes to occur </longdesc> <shortdesc lang="en">Dampening interval</shortdesc> -<content type="integer" default="5s"/> +<content type="string" default="5s"/> </parameter> </parameters> @@ -137,28 +137,30 @@ END check_temperature() { - if [ $1 -lt ${lower_red_limit} ] ; then - ocf_log info "Drive ${DRIVE} ${DEVICE} too cold: ${1} C" - attrd_updater -n "#health-smart" -B "red" -d "${OCF_RESKEY_dampen}" - return 1 - fi + if [ -n "$1" ]; then + if [ $1 -lt ${lower_red_limit} ] ; then + ocf_log info "Drive ${DRIVE} ${DEVICE} too cold: ${1} C" + 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" -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" -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" -B "yellow" -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" -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" -B "yellow" -d "${OCF_RESKEY_dampen}" - return 1 + if [ $1 -gt ${upper_yellow_limit} ] ; then + ocf_log info "Drive ${DRIVE} ${DEVICE} quite hot: ${1} C" + attrd_updater -n "#health-smart" -B "yellow" -d "${OCF_RESKEY_dampen}" + return 1 + fi fi } @@ -350,7 +352,7 @@ fi case "$__OCF_ACTION" in start) HealthSMART_start;; stop) HealthSMART_stop;; - monitor) HealthSMART_monitor;; + monitor) HealthSMART_validate && HealthSMART_monitor;; validate-all) HealthSMART_validate;; reload-agent) HealthSMART_reload_agent;; meta-data) diff --git a/agents/ocf/SysInfo.in b/agents/ocf/SysInfo.in index 5c2c7c7..d3a18f9 100755 --- a/agents/ocf/SysInfo.in +++ b/agents/ocf/SysInfo.in @@ -160,9 +160,11 @@ UpdateStat() { value="$*" printf "%s:\t%s\n" "$name" "$value" if [ "$__OCF_ACTION" = "start" ] ; then - "${HA_SBIN_DIR}/attrd_updater" ${OCF_RESKEY_delay} -S status -n $name -B "$value" + "${HA_SBIN_DIR}/attrd_updater" -d ${OCF_RESKEY_delay} -S status \ + -n $name -B "$value" else - "${HA_SBIN_DIR}/attrd_updater" ${OCF_RESKEY_delay} -S status -n $name -v "$value" + "${HA_SBIN_DIR}/attrd_updater" -d ${OCF_RESKEY_delay} -S status \ + -n $name -v "$value" fi } diff --git a/agents/ocf/o2cb.in b/agents/ocf/o2cb.in index f85d2f4..6db9d2b 100755 --- a/agents/ocf/o2cb.in +++ b/agents/ocf/o2cb.in @@ -366,7 +366,8 @@ meta_data() { <resource-agent name="o2cb" version="@VERSION@"> <version>1.0</version> <longdesc lang="en"> -This Resource Agent controls the userspace daemon needed by OCFS2. +This Resource Agent controls the userspace daemon needed by OCFS2. This agent +is deprecated and will be removed in Pacemaker 3.0.0. </longdesc> <shortdesc lang="en">OCFS2 daemon resource agent</shortdesc> <parameters> |