Forum Discussion

Charles_Harris's avatar
Charles_Harris
Icon for Nimbostratus rankNimbostratus
Mar 10, 2006

iControl / iRules or Health Monitors?

Hello again!

 

 

Since posting the last question about the iControl rules of engagement, I've been looking at our existing solution (very backend monitoring heavy) and have determined that in our environment it will not scale very well.

 

 

To this end, I'm trying to work out if there is any way of setting a dependency on the minimum number of active pool members. I've seen that dependencies can be created on 3DNS, our service requires three wide ip's which are all dependant on each other being available, if any are down, a regional failover occurs (at 3DNS level).

 

 

I'm trying to work out the best method for applying the following logic on BigIP:

 

 

Pool A ( 6 members )

 

 

If Pool A has less than 4 session state active members then mark pool down.

 

 

 

Any comments / advice warmly received as ever!!

 

 

-=ChaZ=-

 

 

 

1 Reply

  • Ok, a blatent interest request......

     

     

    Here's what I've come up with to solve our minimum members requirement, I've got no idea how a health monitor should be written, so this is dirty but very fast....

     

     

    Please advise, comment or ridicule as you see fit ;-D

     

     

    Cheers,

     

     

    -=ChaZ=-

     

     

     

    Can't attach so here it is:

     

     

    !/bin/bash

     

     

    Pool & Member Definitions: Hardcoded for speed

     

     

     

    POOL=3.5_XXX_Pool

     

    POOL_PORT="29XXX"

     

    POOL_MEMBERS="\

     

    1XX.XXX.XXX.XXX:$POOL_PORT \

     

    2XX.XXX.XXX.XXX:$POOL_PORT \

     

    1XX.XXX.XXX.XXX:$POOL_PORT"

     

    POOL_MAXIMUM_NUMBER_OF_DISABLED_MEMBERS=2

     

    POOL_TOTAL_NUMBER_OF_MEMBERS=3

     

     

     

    BP cmd: **ONLY** needs to see DISABLED in any of the output of a status of bp

     

    and INACTIVE,FORCED

     

     

     

    POOL_STATUS_CMD=`bp pool $POOL show`

     

    ARRAYDNT=0

     

    ARRAYFNT=0

     

     

    for BP_OUTPUT in $POOL_STATUS_CMD

     

    do

     

    if [ "$BP_OUTPUT" = "DISABLED" ]

     

    then

     

    (( ARRAYDNT += 1 ))

     

    elif [ "$BP_OUTPUT" = "INACTIVE,FORCED" ]

     

    then

     

    (( ARRAYFNT += 1 ))

     

    fi

     

    done

     

     

    [[ $ARRAYDNT = 0 ]] && echo "up" && exit NOTHING TO DO? Leave BigIP alone.

     

    [[ $ARRAYFNT = $POOL_TOTAL_NUMBER_OF_MEMBERS ]] && echo "down" && exit NOTHING TO DO? Leave BigIP alone.

     

     

     

    If a member is disabled, check for the minimum required and down if not met

     

     

     

    if [ $ARRAYDNT -ge $POOL_MAXIMUM_NUMBER_OF_DISABLED_MEMBERS ]

     

    then

     

    for DISABLE in $POOL_MEMBERS

     

    do

     

    bp pool $POOL member $DISABLE down

     

    done

     

    echo "down"

     

    else

     

    echo "up"

     

    fi

     

     

     

    exit