20-Nov-2014 07:21
I have been hunting for something to help with doing this as I'm not a great with programming. Is there any scripts or api that can be easily used to gain this info?
20-Nov-2014
07:59
- last edited on
02-Jun-2023
11:29
by
JimmyPackets
you can use the tmsh script
e.g. to export the whole LTM configuration you can use
tmsh list ltm
if you need only virtual servers, you can type
tmsh list ltm virtual
Gabriel
20-Nov-2014 08:13
I'm looking for something in a csv without having to group them up
20-Nov-2014 08:38
17-Dec-2016 06:20
v11.6 one liner, no button 🙂
tmsh list ltm virtual {pool destination} | awk '/virtual/{printf "%s,",$3}/destination/{printf "%s,",$2}/pool/{printf "%s,",$2; system("tmsh list ltm "$0" {members} | awk '\''/:/{gsub(/ /, \"\", $0);gsub(/{/, \",\", $0);printf $s,$1}'\''");printf "\n"}' > virtuals.csv
20-Mar-2017 00:36
Thanks for this! The command works really well, apart from an error message and some VSes missing from export: "The requested Pool (/Common/none) was not found."
Also, would it be possible to add an iRule column to the .csv output?
23-Sep-2017 14:25
Try BigIP Report?
https://devcentral.f5.com/codeshare/bigip-report
One day I'll add CSV export functionality. Surprising amount of people that has asked for it.
/Patrik
12-Jul-2018 00:24
Hi all,
tmsh list ltm virtual {pool destination} | awk '/virtual/{printf "%s,",$3}/destination/{printf "%s,",$2}/pool/{printf "%s,",$2; system("tmsh list ltm "$0" {members} | awk '\''/:/{gsub(/ /, \"\", $0);gsub(/{/, \",\", $0);printf $s,$1}'\''");printf "\n"}' > virtuals.csv
Jay code is perfect! It able to export the virtual server and pool for destination. Can the code be modified to allow for virtual server outbound using snat pool?
I have virtual servers used to perform the address translation, and due to an early bug with the LTM, we had to create VS for inbound NAT and outbound NAT, thus we were hoping to generate the view all the in and out bound NAT configurations done.
27-Mar-2019 10:06
works really good if you were smart and didn't use Partitions. Ug!
Trying to make this awesome script work with Partitions.
29-May-2019 07:57
30-Jul-2019 10:08
This code is perfect if you have pools on all your virtual servers. Is there a way to tweak this in such a way that it would go next line when it doesn't see a pool for the virtual server?
05-Feb-2020 14:22
Apologize for my lack of knowledge, where should I excecute this command, on the CLI of an SSH session? I am pretty new in the technology.
19-Dec-2019 08:48
Hello Guys,
I tried this command in v12.1,5 but didn't work. I replaced "awk" with "grep". It is executing the command without any error but not creating the output file. Can someone help?
hostname(tmos)# list ltm virtual {pool destination} | grep '/virtual/{printf "%s,",$3}/destination/{printf "%s,",$2}/pool/{printf "%s,",$2; system("tmsh list ltm "$0" {members} | grep '\''/:/{gsub(/ /, \"\", $0);gsub(/{/, \",\", $0);printf $s,$1}'\''");printf "\n"}' > /var/tmp/virtuals.csv
Display all 133 items? (y/n) y
hostname(/Common)(tmos)#
21-Apr-2020 06:27
Hi all
I update the following script (Script to create csv file have VS name, VS IP, Pool name, Pool Members name => until they using iApps to create the VS and I think also will work with partition), could you please send your feedback.
tmsh list ltm virtual recursive {pool destination} | awk '/virtual/{printf "%s,",$3}/destination/{printf "%s,",$2}/pool/{printf "%s,",$2; system("tmsh list ltm recursive "$0" {members} | awk '\''/:/{gsub(/ /, \"\", $0);gsub(/{/, \",\", $0);printf $s,$1}'\''");printf "\n"}' > virtuals-f5-LTM.csv
17-May-2020 03:35
Hi, I tried above script in v13 but I didn't any file with .csv
tmsh list ltm virtual {pool destination} | awk '/virtual/{printf "%s,",$3}/destination/{printf "%s,",$2}/pool/{printf "%s,",$2; system("tmsh list ltm "$0" {members} | awk '\''/:/{gsub(/ /, \"\", $0);gsub(/{/, \",\", $0);printf $s,$1}'\''");printf "\n"}' > virtuals.csv
09-Aug-2023 08:34
Hi all,
Can someone please confirm how can I run the script in a partition?
I need to export F5 config from a F5 LTM to another and there's a lot of configuration. Please help me to find a way to export and import F5 LTM configurations (VS, pool, nodes). The difference is that in the new F5 LTM the VS IPs, nodes IP and server names are different, but the rest is the same.
This is a like to like migration.