Forum Discussion

Adam_Weigert_18's avatar
Adam_Weigert_18
Icon for Nimbostratus rankNimbostratus
Feb 12, 2009

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 ...

2 Replies

  • 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

     

     

     

  • 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?