Forum Discussion
automate session delete
i have a task to delete specific sesssions every night. is there anyway i can automate this. i looked in the powershell module but there were no delete modules.
i am looking to run the following command every night..
-> delete sys connection cs-server-addr 1.1.1.1 cs-client-addr 1.1.1.100
any ideas??
3 Replies
- mo_99289Historic F5 Account
please refer to SOL https://support.f5.com/kb/en-us/solutions/public/11000/600/sol11635.html?sr=51181919
it contain an example to run tmsh command correctly by crontab
from usage of crontab: refer to https://www.centos.org/docs/5/html/Deployment_Guide-en-US/ch-autotasks.html
Hope it help.
- Theo_12742
Cirrus
The powershell module has some built-ins, but it has access to the API via the Get-F5.iControl object. You should be able to use a combination of get_all_active_connections_v2 and delete_active_connection to achieve your result.
Here's a quick sample on getting the connection list:
(Get-F5.iControl).SystemConnections.get_all_active_connections() - Desai_124243
Nimbostratus
How to write in Powershell? is it like below
$Clientside_ClientipPortDef = new-object -typename iControl.CommonIPPortDefinition $Clientside_ClientipPortDef.address = "10.118.219.205"; $Clientside_ClientipPortDef.port = 4500; $Serverside_ServeripPortDef = new-object -typename iControl.CommonIPPortDefinition $Serverside_ServeripPortDef.address = "10.118.219.198"; $Serverside_ServeripPortDef.port = 4500; $Clientside_ServeripPortDef = new-object -typename iControl.CommonIPPortDefinition $Clientside_ServeripPortDef.address = "10.118.219.220"; $Clientside_ServeripPortDef.port = 4500; (Get-F5.iControl).SystemConnections.delete_active_connection($Clientside_ClientipPortDef,$Clientside_ServeripPortDef,$Serverside_ServeripPortDef)
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