Every time the monitor action is run, this resource agent records (in the CIB) the current number of nodes the host can connect to using the system fping (preferred) or ping tool.
upgrade1="This agent (ocf:pacemaker:pingd) has been replaced by the more reliable ocf:pacemaker:ping."
upgrade2="Attempting automated conversion, run 'crm ra info ocf:pacemaker:ping' for all configuration options"
upgrade3="You will need to remove the existing resource and replace it with one that uses 'ocf:pacemaker:ping' directly"
case "$__OCF_ACTION" in
start|monitor)
- if [ "x" != "x$OCF_RESKEY_host_list" ]; then
+ if [ -n "$OCF_RESKEY_host_list" ]; then
ocf_log err "$upgrade1"
ocf_log err "$upgrade2"
ocf_log err "Automatic conversion to ocf:pacemaker:ping failed: no hosts were configured to check for connectivity"
ocf_log err "$upgrade3"
exit $OCF_ERR_ARGS
fi
recurring=$(crm configure show "$OCF_RESOURCE_INSTANCE" | grep "op monitor.*interval=\"[1-9]" | sed s/.*interval=// | awk -F\" '{print $2}' | sed s/.*interval=// | awk -F\" '{print $2}' | sort | head -n 1)
if [ -z "$recurring" ]; then
ocf_log err "$upgrade1"
ocf_log err "$upgrade2"
ocf_log err "Automatic conversion to ocf:pacemaker:ping failed: no monitor operation configured"
ocf_log err "Without an explicit monitor operation for '$OCF_RESOURCE_INSTANCE', connectivity changes will not be noticed"
ocf_log err "Preventing startup to ensure the issue is addressed before it matters"
exit $OCF_ERR_ARGS
fi
- if [ $OCF_RESKEY_CRM_meta_interval = 0 ]; then
+ if [ $OCF_RESKEY_CRM_meta_interval -eq 0 ]; then
ocf_log warn "$upgrade1"
ocf_log warn "$upgrade2"
- if [ $recurring != $OCF_RESKEY_interval ]; then
+ if [ $recurring -ne $OCF_RESKEY_interval ]; then
ocf_log warn "Your monitor operation happens every $recurring, which means that the $OCF_RESKEY_name attribute will be updated with a different frequency than the previously configured ( $OCF_RESKEY_interval )"
ocf_log warn "Either change the monitor interval to match or, ideally, switch to the ocf:pacemaker:ping agent and avoid all this compatibility nonsense."
fi
fi
;;
meta-data)
cat <<END
<?xml version="1.0"?>
<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
<resource-agent name="pingd" version="1.0">
<version>1.0</version>
<longdesc lang="en">
This agent (ocf:pacemaker:pingd) has been replaced by the more reliable ocf:pacemaker:ping.
It records (in the CIB) the current number of ping nodes (specified in the 'host_list' parameter) a cluster node can connect to.