Adam_Weigert_18
Feb 12, 2009Nimbostratus
Node Screen Name
Is there anyway within an iRule to get the screen name of an active node? I want to avoid having to hard code a class list of node to address since that's already defined in the node definitions.
I basically want to be able to for certain sites direct requests to a specific node (e.g. node1.domain.com goes to node1, node2.domain.com goes to node2, www.domain.com goes to node1 or node2 depending on the pool settings) with something like the following:
foreach node [active_members -list [LB::server pool]] {
set node_address [getfield $node " " 1]
set node_port [getfield $node " " 2]
set node_name [NODE::screen $node_address] SOMETHING LIKE THIS
if { [HTTP::host] starts_with "[$node_name]." } {
node $node_address $node_port
}
}
I know there is a command to retrieve this via iControl and am hoping a similar function is available for an iRule ...