Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
code share

Interface Failsafe Monitor

Problem this snippet solves:

Another slick solution for a couple of common requirement in high performance environments: To fail over immediately when a physical network connection fails connectivity, or if the number of active members in a trunk falls below the configured minimum.

The first sample supports individual interface monitoring. The second supports the more complex trunk management.

How to use this snippet:


Monitor Source: Interface Failsafe only

# (c) Copyright 2007 F5 Networks, Inc.
# Kirk Bauer 
# 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)
b interface show > /tmp/b_interface_show
for i in $interfaces ; do
   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
# All specified interfaces are up...
echo "up"
exit 0

Monitor Source: Interface Failsafe w/Trunk Minumum Active Members support

Comments on this Snippet
Comment made 27-Apr-2018 by dtn 108

b interface show ?

Comment made 27-Apr-2018 by dtn 108

Anyone know how to get the trunk status in version 13 ?

Comment made 12-Jul-2018 by dyobbs 145

nice kirk, do you have such code that monitors the bandwidth interface?