Forum Discussion
Geolocation iRule email alerts
Hi - I have an iRule in place (see below) and would like to enable alerts that will send emails every time it is triggered. Is this possible and what is the best way to set up (i.e. within the same iRule)? Thanks in advance!
when CLIENT_ACCEPTED {
set default_pool [LB::server pool] switch [whereis [IP::client_addr] country] {
CN {
log local0. "Geo Client ([IP::client_addr]) detected as China"
reject }
DE {
log local0. "Geo Client ([IP::client_addr]) detected as Germany"
reject }
AU { log local0. "Geo Client ([IP::client_addr]) detected as Australia"
pool $default_pool }
GB { log local0. "Geo Client ([IP::client_addr]) detected as UK"
pool $default_pool }
default {
log local0. "Geo Client ([IP::client_addr]) not detected"
pool $default_pool }
}
}
2 Replies
- rob_carr
Cirrocumulus
There is a way to do this without extending your iRule, namely generating custom events that lead to email being sent.
Here's the solution explaining how to setup custom events: http://support.f5.com/kb/en-us/solutions/public/3000/600/sol3667.html
Here's the solution explaining how to setup local email resources: http://support.f5.com/kb/en-us/solutions/public/13000/100/sol13180.html
If you are determined to use the iRule, then I suggest looking into sideband connections and how to format SMTP messages.
- SK_121993
Nimbostratus
Thanks for the response. I'll try setting up custom events in the first instance and see how it goes.
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