Forum Discussion

craig_m_254946's avatar
craig_m_254946
Icon for Nimbostratus rankNimbostratus
Jun 28, 2018

How to list VIPs and associated Pool members?

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

  • Anesh's avatar
    Anesh
    Icon for Cirrostratus rankCirrostratus

    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's avatar
    Anesh
    Icon for Cirrostratus rankCirrostratus

    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's avatar
      f51
      Icon for Cirrostratus rankCirrostratus

      Tried in v13 Getting below error

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

  • 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.

  • Rose's avatar
    Rose
    Icon for Altostratus rankAltostratus

    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'

     

     

  • Jate00's avatar
    Jate00
    Icon for Nimbostratus rankNimbostratus

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

    thanks

    • Nathan_F__F5_'s avatar
      Nathan_F__F5_
      Icon for Employee rankEmployee

      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