Forum Discussion
Bhanu_9561
Cirrus
Jun 14, 2013Mark the status of a virtual server down
Hi all,
Is there a way to mark a Virtual Server offline using an iRule?
My requirement is that the Virtual Server should be marked offline by the iRule when a certain conditio...
Kevin_Stewart
Employee
Jun 14, 2013I do not believe there is a way to mark a virtual server down within an iRule.
You can, however, use an iCall in 11.4. Here is a very crude example:
1. Create a script (ex. vi /var/temp/virtual_down.conf)
sys icall script virtualdown {
app-service none
definition {
exec tmsh modify / ltm virtual my_test_vs disabled
}
description none
events none
}
sys icall handler triggered virtualdown {
script virtualdown
subscriptions {
virtualdown {
event-name virtualdown
}
}
}
2. Merge this script into the config:
tmsh load sys config merge file /var/tmp/virtual_down.conf
3. Modify /config/user_alert.conf:
alert local-http-virtualdown "trigger:virtualdown:my_test_vs" {
exec command="tmsh generate sys icall event virtualdown"
}
4. Modify your iRule to generate a syslog statement at the appropriate time:
log local0. "trigger:virtualdown:my_test_vs"
Whenever the iRule generates this alert the iCall will be triggered and consequently disable the virtual server. Here are some parting thoughts:
1. Needless to say, you must make ABSOLUTE sure that you're calling this iCall for the right reason. A mistake in logic can easily turn it into a denial of service.
2. I haven't quite figured out the parameter syntax yet, though the various wiki pages say otherwise. So in this case I'd have to create a separate iCall handler for each virtual server.
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