Forum Discussion

omykhan's avatar
omykhan
Icon for Nimbostratus rankNimbostratus
Dec 30, 2024

TMSH Command to list ASM policies not attached to any virtual servers in all partitions

Hi there,

Can someone help find out the TMSH Command to list ASM policies not attached to any virtual servers in all partitions?

 

  • Hi Omykhan,

     

    You can obtain a list of all virtual servers that have no policy (and hence have no traffic going via ASM) via this command:

    tmsh list ltm virtual one-line | grep -v policies | cut -d' ' -f 3

    Here's a one liner that prints out virtual server and policy names when the policy includes 'asm disable':

    for policy in `tmsh list ltm policy one-line | grep 'asm disable' | cut -d' ' -f3 `; do echo -n `tmsh list ltm virtual one-line | grep $policy | cut -d' ' -f3`; echo ::$policy; done

     

    tmsh show asm virtual | grep -e "Asm::"

    tmsh list ltm virtual all | grep -e -i "policy"

    • omykhan's avatar
      omykhan
      Icon for Nimbostratus rankNimbostratus

      Hi, Thanks for the reply, but that didn't achieve what I required. Here's the scenario;

      There are few partitions in BIG IP; let's say 

      • partition 1
      • partition 2
      • partition 3, and so on 

      And in each partition, there are multiple ASM policies and virtual servers; 

      Let's say in partition 1, there are 

      • VS1 -> attached to ASM1 policy
      • VS2 -> attached to ASM 1 policy
      • VS3 -> attached to ASM2 policy
      • ASM3 policy -> attached to no VS

      So, i need to capture the unused ASM policy information in all partitions that are not attached to any VS

       

      I hope I have clarified this in a detailed way ...