Forum Discussion
Hi ,I want to export VIP and pool details in excel or csv . Can anybody help me regarding this . I am new in F5 world .
See this post for a very similar question. The suggestion was to start by looking at the output of "tmsh list ltm virtual".
I put together a quick bash script for you for this purpose.
echo vs name, destination, pool, pool members
VIRTUALS=$(tmsh list ltm virtual | grep "ltm virtual" | cut -d" " -f3)
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
The output is like this. The vs2 virtual doesn't have a pool or pool members.
vs name, destination, pool, pool members
myvs,0.0.0.0:any,mypool,192.168.1.1 192.168.1.2
vs2,192.168.1.23:http,,
You may need to change some things but that should get you a head start.
- omar_padillaOct 27, 2023Altocumulus
Thank you this is very helpfull, but how can i add the source ip? when i try to modify something i only get errors or nothing at all.
Thank you for you help.
- niirraajJan 10, 2024Nimbostratus
I have modified the script and its working for me
echo vs name, source, destination, pool, pool members
VIRTUALS=$(tmsh list ltm virtual | grep "ltm virtual" | cut -d" " -f3)
for VS in $VIRTUALS;
do
echo -n $VS,
src=$(tmsh list ltm virtual $VS | grep source | cut -d" " -f6)
echo -n $SRC,
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
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com