Forum Discussion
How to get Virtual servers associated with a specific SNAT pool
Hi Everyone,
I need your help as I am trying to get the VSs that are associated with a specific SNAT pool from the command line.
Thanks!
Hi Khaled_HA, you can use awk to print only the virtual name, so to expand on what was provided earlier:
tmsh list ltm virtual one-line | grep "pool SNAT_POOL_NAME" | awk '{print $3}'
Think you may benefit from the following tmsh script: https://community.f5.com/t5/codeshare/config-search/ta-p/277819.
Hope this helps!
tmsh list ltm virtual one-line | grep "pool SNAT_POOL_NAME"
Remark: SNAT_POOL_NAME should not have the same name as an existing LTM pool (and this is a best practice btw)
- Khaled_HAAltocumulus
Hi Amine,
Actually I was using this command, the problem is that it is giving me the whole configuration, while I just need the virtual server name.
So, is there any way to get only the virtual server name ?
Thanks!
Khaled_HA - If your post was solved it would be helpful to the community to select *Accept As Solution*.
Thanks for being part of our community.- JRahmAdmin
Hi F5_Design_Engineer, you'd need to build an iteritive script to accomplish that, first by listing all the vips in that partition, then listing out any snat or snat pool details by querying those objects directly. Can be done on-box with a tmsh script or off-box using iControl REST.
- Khaled_HAAltocumulus
Thank you guys for the support!!
how to get a list of all the SNAT pools or snat-translation or automap details assosiated to all the vips in a partiton other than /Common, i am not finding any such comand or grep command.
I tried following but none of them are working or no output
list ltm virtual all-properties | grep -i -e source-address-translation
show ltm virtual all-properties detail | grep -i -e 'LTM\|Destination'
show ltm virtual all-properties detail | grep -i -e 'LTM\|Destination'
list ltm virtual all-properties | grep -i -e 'LTM\|source-address-translation'
list ltm virtual all-properties one-line | grep -E "LTM\|pool|Destination|source-address-translation"
list ltm virtual one-line | grep -E "LTM\|pool|Destination|SNAT_POOl_NAME"
list ltm virtual one-line | grep "pool SNAT_POOL_NAME" | awk '{print $3}'
I
Other than common? Use TMSH GUI and cd into partition. By default, you will only get list from /Common. So... tmsh; cd /partition_name; your list commands.
I hope my query is not clear
Here it is again
how to get a list of all the SNAT pools or snat-translation or automap details assosiated to all the vips in a partition, any particular grep command we can use , if anyone has done it before using grep command
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