irules challenge
3 TopicsiRule catch all - to redirect if no pool selected
Hi I have multiple VS's setup (~150) that use an iRule to select the appropriate pool based on host header (no default pool assigned in VS config), this is working fine. I have been tasked with writing an iRule to serve up a sorry page when pool members == 0. This is also working fine. My issue is that my syslog server is getting pounded with TCL errors since I applied the sorry_page iRule TCL error: /Common/sorry_page_iRule - no such pool: (line 21) invoked from within "active_members [LB::server pool]" I added a Debug logging rule and found that the majority of the TCL errors are due to pool selection trying to select the Virtual Server IP Address as the pool. This of course triggers the TCL "no such pool" error because I do not name my pools with IP addresses. I would like to add a "catch all" in the sorry_page iRule that "if no pool selected or no such pool / redirect to ; Here are the two iRules I have applied to the multiple Virtual Servers - Pool_Selection_iRule: when HTTP_REQUEST { HTTP::host [string tolower [HTTP::host]] set PoolName "[HTTP::host]_pool" if { [catch { pool $PoolName}] } { } else { pool $PoolName } ` Sorry_Page_iRule: `when LB_FAILED { log -noname "[virtual name] DEBUG: Server Pool: $PoolName SELECTED" if { [active_members [LB::server pool]] == 0 } { log -noname "Sorry Page Activated / Server Pool: $PoolName selection failed on connection attempt from [IP::client_addr]" HTTP::respond 503 content { **a bunch of HTML code here** } Any help would be greatly appreciated.399Views0likes2CommentsSelective Access within Application via iRule
Greetings, iRule experts! I'm trying to block access to certain pages within application using data group but can't make it work. The problem is that blocked and accessible pages are located under the same /Application. Example, URI /Application/Administration/Index.aspx must be blocked, whereas URI /Application/PasswordReset/Index.aspx should be accessible. Another difficulty is that every page has multiple page objects (.js, .css, etc.). What would be best solution for this? Many thanks!237Views0likes2Comments