Forum Discussion
CLI command to look search for a node on all partition
Hello
I use this command to query for the config once I know the virtual name.
----------------------------------------------------------------------------
tmsh show ltm <virtual_name> detail | egrep "Virtual Server: | Destination | Ltm::Pool: | Ltm::Pool Member: | Ltm::ClientSSL Profile" | grep -v "Destination IP Bypasses" | sed 's/Ltm:://g;s/|//g;s/Destination\s*/Destination/g'
----------------------------------------------------------------------------
However, need a couple of different things now:
- Search on all partitions
- Search by the pool member IP
I have close to 400 pool members, each on a different partition, each one in a different pool, and need to find out the virtual name, virtual IP, pool, and pool member for all.
Playing with the following command to see if it might be possible:
tmsh -c 'cd /; show ltm virtual detail recursive' | grep -E '172.30.90.1%|172.30.90.75%'
Any ideas of an easy way to accomplish it?
Thanks Enes_Afsin_Al.
Your script works great. Sample output:
/rsync_load_balancer_vhn0wt_ste_prd/rsync_load_balancer_vhn0wt_ste_prd/serviceMain,/rsync_load_balancer_vhn0wt_ste_prd/172.30.13.91%709:ssh,/rsync_load_balancer_vhn0wt_ste_prd/rsync_load_balancer_vhn0wt_ste_prd/serverpool,172.30.13.85%709 172.30.13.87%709 172.30.13.88%709 172.30.13.89%709In the end, had two options, yours plus:
Command-1:
tmsh -c 'cd /; show ltm virtual detail recursive' | egrep "Virtual Server: | Destination | Ltm::Pool: | Ltm::Pool Member: | Ltm::ClientSSL Profile" | grep -v "Destination IP Bypasses" | sed 's/Ltm:://g;s/|//g;s/Destination\s*/Destination/g' >> /var/tmp/virtual.outCommand 2:
egrep -B 3 '172.30.13.85%|172.30.13.87%|172.30.13.88%|172.30.13.89%' virtual.outExample output:
Virtual Server: rsync_load_balancer_vhn0wt_ste_prd/rsync_load_balancer_vhn0wt_ste_prd/serviceMain
Destination: 172.30.13.91%709:22
Pool: rsync_load_balancer_vhn0wt_ste_prd/rsync_load_balancer_vhn0wt_ste_prd/serverpool
Pool Member: Common/172.30.13.85%709:22
Pool Member: Common/172.30.13.87%709:22
Pool Member: Common/172.30.13.88%709:22
Pool Member: Common/172.30.13.89%709:22Both outputs can be written to a file with the " > filename.csv " or " filename.txt "
Hi shabuboy,
I hope the script in the article will be helpful. The running time of the script will be longer.
I recommend running it on standby device.https://my.f5.com/manage/s/article/K72255145
You can use grep command to filter by node ip address.
./excel.sh | grep 1.2.3.4
Also, you can use Network Map just to view.
- shabuboyAltostratus
Thanks Enes_Afsin_Al.
Your script works great. Sample output:
/rsync_load_balancer_vhn0wt_ste_prd/rsync_load_balancer_vhn0wt_ste_prd/serviceMain,/rsync_load_balancer_vhn0wt_ste_prd/172.30.13.91%709:ssh,/rsync_load_balancer_vhn0wt_ste_prd/rsync_load_balancer_vhn0wt_ste_prd/serverpool,172.30.13.85%709 172.30.13.87%709 172.30.13.88%709 172.30.13.89%709In the end, had two options, yours plus:
Command-1:
tmsh -c 'cd /; show ltm virtual detail recursive' | egrep "Virtual Server: | Destination | Ltm::Pool: | Ltm::Pool Member: | Ltm::ClientSSL Profile" | grep -v "Destination IP Bypasses" | sed 's/Ltm:://g;s/|//g;s/Destination\s*/Destination/g' >> /var/tmp/virtual.outCommand 2:
egrep -B 3 '172.30.13.85%|172.30.13.87%|172.30.13.88%|172.30.13.89%' virtual.outExample output:
Virtual Server: rsync_load_balancer_vhn0wt_ste_prd/rsync_load_balancer_vhn0wt_ste_prd/serviceMain
Destination: 172.30.13.91%709:22
Pool: rsync_load_balancer_vhn0wt_ste_prd/rsync_load_balancer_vhn0wt_ste_prd/serverpool
Pool Member: Common/172.30.13.85%709:22
Pool Member: Common/172.30.13.87%709:22
Pool Member: Common/172.30.13.88%709:22
Pool Member: Common/172.30.13.89%709:22Both outputs can be written to a file with the " > filename.csv " or " filename.txt "
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