Script To list all the ASM policies and how many VS are having ASM policies

Hi Everyone,

I am trying to write a script to list all the ASM policies applied to virtual servers and how many virtual servers are having an ASM policy. Any ideas…

Thanks in advance.

Regards

Hussein

If you run tmsh list /asm policy virtual-servers this will return a list of all of the ASM policies and a list of the virtual servers they are applied to. In my lab environment the output for an ASM policy with virtual servers looks like so:

asm policy testme { virtual-servers { testme } }

While the output on an unused policy looks like so:

asm policy testmenostage { virtual-servers none }

It would be fairly easy to either run this via ssh or have it run in a shell script on the ASM. I suspect you could likely do the same thing via iControl or REST, but I have not tested this.