F5 批量檢查pool member狀態的腳本
這個腳本是用來檢查pool member狀態,如果down了就在/var/log/messages 列印日誌,這個可以輔助檢查是哪個pool的哪個member down了。可以弄成cron task。
#!/bin/sh
# Pool Member watch script for Big-IP V9-10
#
#——————————————————————————-
# Init
#——————————————————————————-
POOL_FLG=0
#——————————————————————————-
# Check status
#——————————————————————————-
#/usr/bin/logger -is -p debug "Script $0 start."
# Pool Member watch script for Big-IP V9-10
#
#——————————————————————————-
# Init
#——————————————————————————-
POOL_FLG=0
#——————————————————————————-
# Check status
#——————————————————————————-
#/usr/bin/logger -is -p debug "Script $0 start."
#check how much member down
POOL_FLG=`/bin/bigpipe pool | grep -c "down"`
POOL_FLG=`/bin/bigpipe pool | grep -c "down"`
if [ $POOL_FLG -ne 0 ]; then
#echo number of down pool members
/usr/bin/logger -is -p warn "Script $0 checked $POOL_FLG Members down. "
#echo number of down pool members
/usr/bin/logger -is -p warn "Script $0 checked $POOL_FLG Members down. "
#check IP address of down members
DOWN_MEMBER=`/bin/bigpipe pool show | /bin/awk '/down/{ print $4 }'`
DOWN_MEMBER=`/bin/bigpipe pool show | /bin/awk '/down/{ print $4 }'`
#Loop
for I in ${DOWN_MEMBER}
do
#echo IP address of down members
/usr/bin/logger -is -p warn "Script $0 checked ${I} is down. Check BIG-IP status."
done
fi
for I in ${DOWN_MEMBER}
do
#echo IP address of down members
/usr/bin/logger -is -p warn "Script $0 checked ${I} is down. Check BIG-IP status."
done
fi
沒有留言:
張貼留言