Forum Discussion

nikzin_341815's avatar
nikzin_341815
Icon for Nimbostratus rankNimbostratus
Jan 12, 2018

tmsh command

Hello, i am searching for tmsh command which list all virtual server with a special http profile (for example http_profile_1). Any idea ? Thank you ! Nick

 

4 Replies

  • This may not not be ideal, let me know how you get on

    list ltm virtual profiles | grep -B 2 /Common/http

    (tmos) list ltm virtual profiles | grep -B 2 /Common/http
    ltm virtual vs_80 {
        profiles {
            /Common/http {
    --
    ltm virtual vs_443 {
        profiles {
            /Common/http {
    
  • TechT's avatar
    TechT
    Icon for Nimbostratus rankNimbostratus

    try this - tmsh list ltm virtual | grep http_profile_1 -A "line no"

     

    eg : tmsh list ltm virtual | grep http_profile_1 -A 5

     

    *line no : depends on the line you want to display

     

  • Tested this out and it seems to be working for me:

     

    list ltm virtual profiles { http_profile_1 } | grep -B 2 "http_profile_1" | grep ltm virtual

     

  • If you run the command outside of tmsh you can use some more tools to help you. Then you can try something like this which enables you to search for anything in the server config:

     

    tmsh list ltm virtual one-line | grep PROFILE-NAME | awk {'print $3'}

     

    or if you have partitions in your big-ip:

     

    tmsh list ltm virtual /PARTITION/* one-line | grep PROFILE-NAME | awk {'print $3'}

     

    EDIT: If you have partitions you have to insert a \ before the *. This editor seems to remove it when i post it here.