Forum Discussion
Adam_Weigert_18
Nimbostratus
Feb 12, 2009Node 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 ...
2 Replies
- The_Bhattman
Nimbostratus
You might want to look at this set of commands
Click here to look at the set of commands that allows you to perform DNS query, returning the A record for the indicated hostname, or the PTR record for the indicated IP address.
Hope this helps
CB - adharkrader
Nimbostratus
Did anything like this get implemented? It would seem like the properties of the various "lists" (pools, nodes, etc) should be accessible in an iRule... or am I missing the obvious?
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