Forum Discussion
mtaylornz
Nimbostratus
Mar 20, 2014iCall script to add and remove iRules based on log message
Hey I'm brand new to these iCalls and trying to get a handle on how I would use a log message to add an iRule
Any tips?
John_Alam_45640
Mar 20, 2014Historic F5 Account
You don’t need a full iCall since it is a simple script, you can do it like this:
Text to add to /config/user_alert.conf
alert IRULE_ADD "text in log that triggers irule add" {
exec command="tmsh modify ltm virtual virtual_name rules { irule_name }"
}
To remove:
alert IRULE_REMOVE "text in log that triggers irule remove" {
exec command="tmsh modify ltm virtual virtual_name rules none"
}
If you had a bigger process that is being triggered you can do this:
alert IRULE_ADD "text in log that triggers irule add" {
exec command=" tmsh generate sys icall event BIG_SCRIPT_EVENT"
}
Then you would have:
sys icall handler triggered BIG_SCRIPT_HANDLER {
script BIG_SCRIPT
subscriptions {
BIG_SCRIPT_EVENT {
event-name BIG_SCRIPT_EVENT
}
}
sys icall script BIG_SCRIPT {
app-service none
definition {
script command here……
.
.
}
description “Script started by handler BIG_SCRIPT which is trigger by BIG_SCRIPT_EVENT”
events none
}
Help 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