Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPaddr2: add nic_monitor function so VIP can takeover by the other node WHEN t… #916

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions heartbeat/IPaddr2
Original file line number Diff line number Diff line change
Expand Up @@ -970,13 +970,22 @@ ip_stop() {
exit $OCF_SUCCESS
}

nic_monitor()
{
ps -ef|grep -w "NetworkManager"|grep -v grep &> /dev/null
if [ "$?" -ne 0 ];then
ethtool $NIC|grep "Link detected: yes" &> /dev/null
fi
}

ip_monitor() {
# TODO: Implement more elaborate monitoring like checking for
# interface health maybe via a daemon like FailSafe etc...

local ip_status=`ip_served`
case $ip_status in
ok)
nic_monitor || return $OCF_ERR_GENERIC
$ARP_SEND_FUN refresh
return $OCF_SUCCESS
;;
Expand Down