LTM: Interface Failsafe
Published Mar 05, 2008
Version 1.0Was this article helpful?
!/bin/bash
Copyright 2007 F5 Networks, Inc.
Kirk Bauer kirk@f5.com
modifed by Vincent Li v.li@f5.com to avoid possible I/O buffer
Pass in each interface to monitor via the Arguments field in the GUI
Collect arguments (first remove IP and port as we don't use those)
shift
shift
interfaces="$*"
b interface show > /tmp/b_interface_show
for i in $interfaces ; do
status=`b interface $i show | tail -1 | awk '{print $2}'`
status=`grep "^ *$i " /tmp/b_interface_show | awk '{print $2}'`
if [ "$status" != "UP" ] ; then
logger -p local0.notice "$MON_TMPL_NAME: interface $i is not up (status: $status)"
exit 1
fi
done
All specified interfaces are up...
logger -p local0.notice "$MON_TMPL_NAME: interface $i is up (status: $status)"
echo "up"
exit 0