kdumpctl: for fence_kdump, the ipaddr of this node should be excluded from list

kdump should not send fence_kdump notifications to local host, because
the role of the falied node (i.e local host) is to send fence_kdump
notifications to other nodes to tell them I'm kdumping, tell to itself is
nonsense. And we have excluded hostname of local host but when one use ip
address we also need exclude it.

Signed-off-by: Pingfan Liu <piliu@redhat.com>
Reviewed-by: Xunlei Pang <xlpang@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
This commit is contained in:
Pingfan Liu 2017-05-17 11:16:22 +08:00 committed by Dave Young
parent b74479521c
commit 1ca4c9f009
2 changed files with 10 additions and 3 deletions

View File

@ -136,9 +136,9 @@
# all valid arguments except hosts to send notification to).
#
# fence_kdump_nodes <node(s)>
# - List of cluster node(s), separated by spaces, to send
# fence_kdump notifications to (this option is mandatory to
# enable fence_kdump).
# - List of cluster node(s) except localhost, separated by spaces,
# to send fence_kdump notifications to.
# (this option is mandatory to enable fence_kdump).
#
#raw /dev/vg/lv_kdump

View File

@ -1099,6 +1099,7 @@ check_kdump_feasibility()
check_fence_kdump_config()
{
local hostname=`hostname`
local ipaddrs=`hostname -I`
local nodes=$(get_option_value "fence_kdump_nodes")
for node in $nodes; do
@ -1106,6 +1107,12 @@ check_fence_kdump_config()
echo "Option fence_kdump_nodes cannot contain $hostname"
return 1
fi
# node can be ipaddr
echo $ipaddrs | grep $node > /dev/null
if [ $? -eq 0 ]; then
echo "Option fence_kdump_nodes cannot contain $node"
return 1
fi
done
return 0