F5 shell脚本输出配置到csv表格
背景:通过shell脚本输出F5配置到csv表格
1.创建脚本
sh
vi f5config.sh
echo vs name, destination, pool, pool members
VIRTUALS=$(tmsh -q -c "cd / ; list /ltm virtual recursive" | grep "ltm virtual" | awk -F' ' '{print "/"$3}')
for VS in $VIRTUALS;
do
echo -n $VS,
DEST=$(tmsh list ltm virtual $VS | grep destination | cut -d" " -f6)
echo -n $DEST,
POOL=$(tmsh list ltm virtual $VS | grep pool | cut -d" " -f6)
echo -n $POOL,
if [ -n "$POOL" ];
then
MBRS=$(tmsh list ltm pool "$POOL" | grep address | cut -d" " -f14)
echo -n $MBRS
fi
echo
done
2.赋予脚本执行权限
sh
chmod 777 excel.sh
3.执行脚本
sh
./excel.sh >> f5config.csv
4.把csv表格下载到本地打开即可
5.官方参考链接
html
https://support.f5.com/csp/article/K72255145?utm_source=f5support&utm_medium=RSS