Forum Discussion
Question on Interface fail-safe script
Dears, Can some one assist me to understand what the script below exactly did:
shift shift
interfaces="$*"interfaces="1/2.1 1/2.3 2/2.1" b interface show > /tmp/b_interface_show for i in $interfaces ; do status=
grep "^ *$i " /tmp/b_interface_show | awk '{print $2}'
logger -p local0.notice "interface $i is parced and status is $status"
if [ "$status" = "DN" ] ; then logger -p local0.notice "$MON_TMPL_NAME: interface $i is DOWN (status: $status)" for f in $interfaces ; do logger -p local0.notice "$MON_TMPL_NAME: bring down other interfaces" if [ $f != $i ] ; then b interface $f disable fi done echo "failed" > /tmp/int_fail_state exit 1 fi if [ "$status" = "UP" ] ; then state=
cat /tmp/int_fail_state
if [ "$state" = "failed" ] ; then
logger -p local0.notice "$MON_TMPL_NAME: interface $i is back UP (status: $status)"
for f in $interfaces ; do
logger -p local0.notice "$MON_TMPL_NAME: bring UP interface $f in group ($interfaces)"
b interface $f enable
done
echo "ok" > /tmp/int_fail_state
fi
fi
done
All specified interfaces are up...
echo "up" exit 0
I have Active F5a and Standby F5b and need to do fail safe interface between them. Once I apply it on F5a (active) and interfaces 1/2.1 and 2/2.2 still up; F5a changed to standby and another F5 didn't go active. I have other monitor for interface fail safe for interfaces 1/2.1 1/2.3 2/2.1. Please I need to understand this script very clearly to know the reason that made F5a goes to standby.
One important thing that is these interfaces connected with EFS routers which they didn't accept ICMP traffic (ping). Is it possible that F5 sending test traffic (like ping) to check the status of these interfaces if up or no, and while it send there were no reply and it mark it as 'DOWN" and the fail worked?
Many thanks.