09-May-2016 10:43
09-May-2016
11:22
- last edited on
04-Jun-2023
17:37
by
JimmyPackets
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,
09-May-2016 13:01
09-May-2016
11:22
- last edited on
04-Jun-2023
17:37
by
JimmyPackets
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,
09-May-2016 13:01
09-May-2016
11:44
- last edited on
04-Jun-2023
17:37
by
JimmyPackets
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.
12-Apr-2023 08:52
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