For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Jinshu's avatar
Jinshu
Icon for Cirrus rankCirrus
Sep 21, 2016

GTM Question

Is it possible to make GTM decisions based on number of LTM pool member availability? Consider GTM and LTM are in single device.

 

2 Replies

  • Possible if you use an iRule.

    Something like this:

    when DNS_REQUEST {
      if { [active_members pool_test] < 1 } {
        pool POOL_TEST_Fallback
      } else {
        pool pool_test
    }
    
  • I have found an alternate solution to do this.

    Configure below script as external monitor. Create new monitor using this external script and append it in the VIP along with your existing health monitor. Change the 'Availability Requirement ' to 'All'.

    Above script monitor the availability of the pool members. If it is less than 3, then it will change the wide-ip lb method.

    !/bin/sh
    pidfile="/var/run/$MONITOR_NAME.$1..$2.pid"
     Send signal to the process group to kill our former self and any children
     as external monitors are run with SIGHUP blocked
    if [ -f $pidfile ]
    then
        kill -9 -`cat $pidfile` > /dev/null 2>&1
    fi
    echo "$$" > $pidfile
    
    pool=Enter Pool Name
    minup=3
    virtual=Enter VIP name
    wideip=Enter Wide IP Name
    
    upmembers=`tmsh show /ltm pool $pool members |grep "Current Active Members" |awk -F" : " '{ print $2 }'`
    
    if [ $upmembers -ge $minup ]
    then
        rm -f $pidfile
        state=`tmsh show /gtm wideip $wideip | grep "Availability" |awk -F" : " '{ print $2 }'`
        if [ $state == "available" ]
        then
            logger -p local0.info -t MONITOR-ALERT "Pool $pool Monitor UP - changing the lb method to global-availability"
            tmsh modify /gtm wideip $wideip pool-lb-mode global-availability
        fi
        echo "up"
    else
        rm -f $pidfile
        state=`tmsh show /gtm wideip $wideip | grep "Availability" |awk -F" : " '{ print $2 }'`
        if [ $state == "available" ]
        then
            logger -p local0.info -t MONITOR-ALERT "Pool $pool Monitor DOWN - changing the lb method to ratio"
            tmsh modify /gtm wideip $wideip pool-lb-mode ratio
        fi    
        echo "up"
    fi
    

    -Jinshu