F5 批量检查pool member状态的脚本

www.net130.com     日期:2010-10-7    浏览次数:

这个脚本是用来检查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.”

#check how much member 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. ”

#check IP address of down members
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

分享道
相关新闻