Forum Discussion

Muthu_108845's avatar
Muthu_108845
Icon for Nimbostratus rankNimbostratus
Aug 02, 2017

External Monitor script rewrite from 10.2.1 to 12.1.2

I have external Monitor configuration for the Version10.2.1. can someone help me to convert the script into 12.1.2 version Here is the script

!/bin/bash This version certified for use with LTM v10.2.1

IP=

echo $1 | sed 's/::ffff://'
output="$(/usr/bin/curl -s -m 15 -A "BigIP Prober" -H "Host: $4" -H "Connection: close" http://$1:$2$3 2>/dev/null)" case $output in Server\ Up)

    if [ -f "/var/tmp/disabled/disabled.$5.$IP.$2" ]; then
            b pool $5 member ${IP}.${2} session enable >> /tmp/enable 2>&1
            rm /var/tmp/disabled/disabled.$5.$IP.$2
    fi
echo "UP"

;; Server\ Drain) status=$(b pool $5 member ${IP}.${2} session show | awk '{print $6}') if [ "$status" != "disable" ]; then b pool $5 member ${IP}.${2} session disable >> /tmp/test 2>&1 > /var/tmp/disabled/disabled.$5.$IP.$2 fi echo "DRAIN" ;; Server\ Down) Do Nothing Here ;; esac

1 Reply

  • Here is the script

    !/bin/bash This version certified for use with LTM v10.2.1

    IP=

    echo $1 | sed 's/::ffff://'
    output="$(/usr/bin/curl -s -m 15 -A "BigIP Prober" -H "Host: $4" -H "Connection: close" http://$1:$2$3 2>/dev/null)" case $output in Server\ Up)

        if [ -f "/var/tmp/disabled/disabled.$5.$IP.$2" ]; then
                b pool $5 member ${IP}.${2} session enable >> /tmp/enable 2>&1
                rm /var/tmp/disabled/disabled.$5.$IP.$2
        fi
    echo "UP"
    

    ;; Server\ Drain) status=$(b pool $5 member ${IP}.${2} session show | awk '{print $6}') if [ "$status" != "disable" ]; then b pool $5 member ${IP}.${2} session disable >> /tmp/test 2>&1 > /var/tmp/disabled/disabled.$5.$IP.$2 fi echo "DRAIN" ;; Server\ Down) Do Nothing Here ;; esac