Forum Discussion

ashish_solanki's avatar
Jun 14, 2019
Solved

Need to apply profile with script

Hi All,

 

Need some help in creating a script in which I have to apply X-forwarded-for feature enabled http profile on already working 100's of VIPs on physical or virtual load balancer.

 

Thanks in advance!!!

 

Best Regards,

Ashish Solanki

 

 

4 Replies

  • Hello.

    You can do it in four simple steps

    1) Capture all VS configured in '/Common' partition

    # tmsh list ltm virtual one-line | awk '{ print $3 }' > output.txt

    2) Manually remove from 'output.txt' those VS that you don't want to modify

    3) Change the HTTP profile in all VS in that list

    # cat output.txt | xargs -I {} tmsh modify ltm virtual {} profiles add { <new_http_profile> } profiles delete { <current_http_profile> }

    4) Save config from running-config to startup-config

    # tmsh save sys config

    KR,

    Dario.

  • Hi Dario,

     

    Thanks for the script it worked perfectly as I wanted.

     

    Can you help me understand few things in the script :

     

    1. In awk '{ print $3 }' what is print $3
    2. xargs -I {} --> please help me understand this

    Thanks again for your help.

     

    Best Regards

    Ashish Solanki

  • Thanks a lot again :), Dario.

     

    Need some more help. I'm preparing for 201 exam I have taken this exam and would like to share result with you and need your feedback on the ones which are not correct.

     

    Also, are you on LinkedIn I would like to add you as my connection if you don't mind.

     

    Thanks in advance!!