Forum Discussion
pdiab_72047
Nimbostratus
Oct 05, 2015can I automate jobs using tmsh ?
i am looking to apply some irule ( maintenance page) on our external VIPs on the weekend and i want to automate this. Is there a way to use tmsh to apply irule on external VIP at a certain time( i w...
Hannes_Rapp
Nimbostratus
Oct 05, 2015Hello,
Using the Crontab is an option, but it has a drawback - if you upgrade the software, all Crontab config will be lost. Furthermore, Crontab resides outside TMOS, therefore any config in it will not be syncronized, and has to be managed separatelly on each HA cluster member.
Note1: do not forget the "REMOTEUSER = root", otherwise you will not be able to issue TMSH commands from the Crontab!
Note2: make sure you do not forget to include all the non-maintenance iRules (if you have any) since this TMSH command will replace all the existing rules with new ones. There's no "add/remove" option for the iRules in TMSH.You can use my sample below, tweak it as needed.
crontab -e - opens the crontab config
REMOTEUSER = root
00 01 * * Sat tmsh modify ltm virtual MyVS rules { maintenance_irule another_irule }
adds the maintenance page iRule @ 01:00 system-time on every Saturday (1 hour after midnight)
00 23 * * Sun tmsh modify ltm virtual MyVS rules { another_irule }
removes the maintenance page iRule @ 23:00 system-time on every Sunday (1 hour before midnight)
:wq - saves the crontab configHelp guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects