星期二, 4月 02, 2013

F5 批量檢查pool member狀態的腳本

F5 批量檢查pool member狀態的腳本
(http://www.net130.com/CMS/Pub/special/special_F5/2010_10_07_78461.htm)
這個腳本是用來檢查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

沒有留言:

LinkWithin-相關文件

Related Posts Plugin for WordPress, Blogger...