cancel
Showing results for 
Search instead for 
Did you mean: 

How to list VIPs and associated Pool members?

craig_m_254946
Nimbostratus
Nimbostratus

I have several F5 devices running versions 11.4.1 HF3 to 11.6.1 HF2.

 

I found other similar questions that have been answered, but the commands don't seem to work with these versions.

 

My customer is asking for a list of IPs used on their devices, VIPs and Pool members.

 

9 REPLIES 9

Anesh
Cirrostratus
Cirrostratus

Have u tried below

 

tmsh show ltm virtual detail | egrep "Virtual Server: | Destination | Ltm::Pool: | Ltm::Pool Member: " | grep -v "Destination IP Bypasses" | sed 's/Ltm:://g;s/|//g;s/Destination\s*/Destination/g'

Anesh
Cirrostratus
Cirrostratus

Tried this in 11.5.x, should work in other version mentioned by you as well, the only change in the command i made is the switch -E

 

tmsh show ltm virtual detail | grep -E "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'

f51
Nimbostratus
Nimbostratus

Tried in v13 Getting below error

Syntax Error: "sed", grep is currently the only filter that is supported

Jate00
Nimbostratus
Nimbostratus

This may not be the place to ask, but can you tell me what the pipe character enclosed in the quoted sting does?

thanks

Hi Jate00,

 

I did not write the command but I may be able to help. Are you referring to the pipe character that sits between "Virtual Server:" and "Destination" for example? If you are then I believe that pipe is basically just telling the grep command to search for each of those strings individually.

 

For example, with the pipe between "Virtual Server:" and "Destination" grep knows to search for "Virtual Server:" and "Destination" separately. Without the pipe between them grep would be searching for "Virtual Server: Destination" as if it were one string instead of two and would not find a match because there is no string that matches "Virtual Server: Destination".

 

-Nathan F

 

 

egrep and grep -E are same. Its an extended. Lets say you want to search multiple variables in a line or a file (basically an input). You can simply use grep -E "variable1 | variable2 | variable3"

 

Example:

If a file has the below 5 lines in it.

The file has 4 entries first line second line third line fourth line

 

#cat file | grep first

first line

#cat file | grep -E "first | second"

first line second line

#cat file | grep line

first line second line third line fourth line

 

Hope you got the idea.

Jate00
Nimbostratus
Nimbostratus

Thanks guys, it does make sense now.

Rose
Altostratus
Altostratus

I have tried with these 2 commands, but it doesn't give an outpuT after the command is entered. This is on the 12.x.x version

 

show ltm virtual detail | grep "Virtual Server: | Destination | Ltm::Pool: | Ltm::Pool Member: | IP Address" | grep -v "Destination IP Bypasses" | grep 's/Ltm:://g;s/|//g;s/Destination\s*/Destination/g'

 

 

show ltm virtual detail | grep -E "Virtual Server: | Destination | Ltm::Pool: | Ltm::Pool Member: | IP Address" | grep -v "Destination IP Bypasses" | grep 's/Ltm:://g;s/|//g;s/Destination\s*/Destination/g'

 

 

You need to redirect to a file to view output.

>> filename