Forum Discussion
Filip_Mikulík
Apr 09, 2018Altostratus
Hi, yes that is possible:
- export ASM policy: save asm policy [policy name] xml-file [file name]
- copy XML files to DR
- import ASM policy: load asm policy [policy name] file [file name]
- (optional) active imported policy: modify asm policy [policy name] active
if you want to save all policies from box you can use something like:
for i in $(tmsh list asm policy \/\*\/\* one-line | cut -d " " -f 3); do echo ${i}; tmsh save asm policy ${i} xml-file ${i}.xml; done
than copy it and import it by:
for i in $(find . -name '*xml); do echo ${i}; tmsh load asm $(echo ${i} | sed 's/\.xml//') xml-file ${i}; tmsh modify asm policy $(echo ${i} | sed 's/\.xml//') enable; done
This should be functional if you don't use partitions. If you do, you will have to create the directories with partition names first, or try to substitute '/' character in policy names...