Forum Discussion
Cronjob that checks every 15 min if there is no APM active session, than disable the virt.
Hello there,
My goal is to check every 15 minutes if there is no active APM session , if not, disable the virt.
i thought i will have a bash script that i can call from crontab with the timing: 0,15,30,45 * * * * /var/tmp/disablevirt
and check if there is an active connections with snmpwalk: snmpwalk -Os -c public -v 2c localhost apmPaStatCurrentActiveSessions | grep PROFILENAME
if VALUE is equal to 0, run this: tmsh modify ltm virtual virt_NAME disabled else echo "Users are still connected."
Thanks for the help.
- Dan_73594Historic F5 Account
Looks like you got it working, just wanted to add that a periodic iCall may be a better fit if this is a long term solution because it would: 1) Be replicated to non-master blades (if using clustering with VIPRION) and 2) Sync between devices in a DSC group, persist upgrades, etc.
Dan
- HamishCirrocumulus
Great... But what's going to re-enable it? Because this'll be a one-shot and once it's disabled, no user will be able to connect again until something else re-enables it...
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