Forum Discussion
Michael_-_Harr1
Nimbostratus
Jan 10, 2017Help with IRULE to send status 500 if all members of pool equal 0 and code 200 if at least 1 member is operational
Need help with IRULE please,
URL from client application https://online.mydomain.org/statusCheck2 to send a status code 500 if there are 0 pool members and if there at least 1 pool member send status code 200
In help creating this IRULE would be greatly appreciated.
2 Replies
This might work:
when HTTP_REQUEST { if { [string tolower [HTTP::uri]] eq "/statuscheck2" && [active_members ] > 0 }{ HTTP::respond 200 content "" } else { HTTP::respond 500 content "" } }Replace
andpool_name
with the correct values.your content/Patrik
- Vijay_E
Cirrus
This is an untested, rough iRule that you have to alter to suit your needs:
when HTTP_REQUEST { if { [active_members WEB_POOL] < 1 } { HTTP::respond 500 Location "https://online.mydomain.org/statusCheck2" } elseif { [active_members WEB_POOL] > 0 } { HTTP::respond 200 Location "https://online.mydomain.org/statusCheck2" } }You can probably use switch instead of if-else.
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