Hi ,I want to export VIP and pool and pool menbers details in excel or csv . Can anybody help me regarding this . I am new in F5 world .
Regards
Amol S. Allewar
Hi ,I want to export VIP and pool and pool menbers details in excel or csv . Can anybody help me regarding this . I am new in F5 world .
Regards
Amol S. Allewar
F5 BigIP LTM configuration is not what you would normally manage in an Excel spreadsheet. Formatting would probably be a major overhead.
If you insist, you can get started by the following two commands:
Print out all LTM Virtual Server configurations, one row per VS
tmsh list ltm virtual one-line
Print out all LTM Pool configurations, one row per Pool
tmsh list ltm pool one-line
When done, you can paste the outputs to your Excel spreadsheet and split the values to multiple columns (use âspaceâ as field separator). You will still have to manually format whatâs left to make it human-usable documentation.
Regards,
F5 BigIP LTM configuration is not what you would normally manage in an Excel spreadsheet. Formatting would probably be a major overhead.
If you insist, you can get started by the following two commands:
Print out all LTM Virtual Server configurations, one row per VS
tmsh list ltm virtual one-line
Print out all LTM Pool configurations, one row per Pool
tmsh list ltm pool one-line
When done, you can paste the outputs to your Excel spreadsheet and split the values to multiple columns (use âspaceâ as field separator). You will still have to manually format whatâs left to make it human-usable documentation.
Regards,
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.
Thanks . My LTM is configured in multiple partition . When i enter this command i am not getting any output . Version : 11.4.1 . Please suggest .
Thanks . My LTM is configured in multiple partition . When i enter this command i am not getting any output . Version : 11.4.1 . Please suggest .
Hey guys,
I stumbled upon this thread by the article https://my.f5.com/manage/s/article/K72255145. Together with my go to dev ops guy I refined the script a little bit. Especially he added regexp to filter the IP addresses. I added the columns for WAF policies. Because there are two ways to implement WAF policies there are two columns for this. If you donât need this just comment the strings out of the script.
Hope this helps.
echo BIG-IP,vs name,destination,pool,pool members,WAF_profiles,WAF_policies
VIRTUALS=$(tmsh -q -c "cd / ; list /ltm virtual recursive" | grep "ltm virtual" | awk -F' ' '{print "/"$3}')
for VS in $VIRTUALS;
do
HOST=$(tmsh list sys global-settings hostname | grep hostname | cut -d" " -f6)
echo -n $HOST,
echo -n $VS,
DEST=$(tmsh list ltm virtual $VS | grep destination | grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}')
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 | grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}')
echo -n $MBRS,
fi
WAF_profiles=$(tmsh list ltm virtual $VS | grep -A 1 profiles | grep ASM | cut -d" " -f9)
echo -n $WAF_profiles,
WAF_policies=$(tmsh list ltm virtual $VS | grep -A 1 policies | grep asm | cut -d" " -f9)
echo -n $WAF_policies
echo
done
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.
Though the question is very old I am answering it for someone who still looking for the answer.
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