Forum Discussion
Is it possible to change vservers according to a specified time?
Hi Shakoor,
to change a TCP profile (or issue other TMSH command lines as needed) on a periodic interval you may use the rather simple iCall scripts and handlers below. The provided example will flip the client/server side TCP protocols every 30 seconds...
sys icall script TCP_Profile_LAN_WAN_SWAP {
app-service none
definition {
tmsh::log "iCall: Swapping the TCP_Profile from LAN to WAN"
tmsh::modify /ltm virtual VS_HTTPS_211 { profiles replace-all-with { tcp-lan-optimized { context clientside } tcp-wan-optimized { context serverside } http {} httpcompression { } clientssl { context clientside } serverssl { context serverside } } }
}
description none
events none
}
sys icall script TCP_Profile_LAN_WAN_FIX {
app-service none
definition {
tmsh::log "iCall: Fixing the TCP_Profile settings"
tmsh::modify /ltm virtual VS_HTTPS_211 { profiles replace-all-with { tcp-lan-optimized { context serverside } tcp-wan-optimized { context clientside } http {} httpcompression { } clientssl { context clientside } serverssl { context serverside } } }
}
description none
events none
}
sys icall handler periodic TCP_Profile_LAN_WAN_SWAP {
first-occurrence 2016-08-09:15:00:00
interval 60
script TCP_Profile_LAN_WAN_SWAP
}
sys icall handler periodic TCP_Profile_LAN_WAN_FIX {
first-occurrence 2016-08-09:15:00:30
interval 60
script TCP_Profile_LAN_WAN_FIX
}
Note: You have to adopt the settings to match your Virtual Server name(s), the desired profiles settings and the periodic intervals (in seconds) as needed. Then use
to import and merge the partial configuration.tmsh load sys config merge from-terminal
Cheers, Kai
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com