Forum Discussion
Create a node based on an event
Hi ottleydamian,
dont think iCall would be a good choice for your requirement.
ISTAT based triggers adding some (unpredictable) latency and LOG based triggers wont be able to pass the entire log-line (including the requested HOSTHEADER) to your iCall scripts.
It would be far more stable and elegant to SIDEBAND out of your iRule to F5's REST-API and create a new pool member or to use DevCentrals "Action On Log" contribution (https://devcentral.f5.com/codeshare?sid=430) to automate the pool member creation.
Beside of this, what is the purpose of having those pool members in place? You could also perform a a simple DNS lookup (after visiting DNS-Caches) within your iRule and then forward the traffic based on the DNS responses.
when HTTP_REQUEST {
Extract the HOSTNAME value...
set fqdn [URI::query [HTTP::uri] hostname]
You may want to add some additional tests to make sure the passed HOSTNAME values are legit!!!!
if { $fqdn ne "" } then {
if { [set resolved_ip [table lookup "dns_cache_$fqdn"]] ne "" } then {
Found a cached DNS response...
node $resolved_ip
} else {
Need to DNS resolve the IP address
if { [set resolved_ip [lindex [RESOLV::lookup @8.8.8.8%1 -a $fqdn] 0]] ne "" } then {
Found an IP address. Updating DNS cache (for 60 sec) and forwarding the request to the just resolved IP.
table set "dns_cache_$fqdn" $resolved_ip indef 60
node $resolved_ip
} else {
HOST not found...
HTTP::respond 200 content "HOST not found..." "Content-type" "text/html"
}
}
} else {
Empty hostname param...
HTTP::respond 200 content "Empty hostname value..." "Content-type" "text/html"
}
}
Cheers, Kai
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