Forum Discussion
can 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 want to automate the process like a cron job or something within tmsh) ? or can I use EM ? currently we are using 3rd party to push the config over the weekend but it is failing sometimes due to a 3rd party software issue. any suggesting is appreciated.
6 Replies
- Hannes_Rapp
Nimbostratus
Hello,
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.
- opens the crontab configcrontab -eREMOTEUSER = 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)
- saves the crontab config:wq - pdiab_72047
Nimbostratus
so applying the Sunday irlue all it does is remove the existing ones ? does rebooting the box cause the crontab to loose its config ? thanks for the prompt reply
- pdiab_72047
Nimbostratus
never mind about this >> "so applying the Sunday irlue all it does is remove the existing ones " can you please answer this one though ? >> "does rebooting the box cause the crontab to loose its config ?" appreciate it !!
- Hannes_Rapp
Nimbostratus
Nope, that is given that you reboot to the same partition.
- pdiab_72047
Nimbostratus
much appreciated !!
- kouriada_284551
Nimbostratus
Hello, and what could be different way to automaticly run jobs instead of using crontab, for example I have implemmeted bunch of tmsh commands in crontab which sending for expample reports to my email (expiration of cert, status HA, etc), I am just curious about different ways (maybe will be better for administration and maintenance for me...).
Thank you for hints AK
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