Forum Discussion

rb1980_75708's avatar
rb1980_75708
Icon for Nimbostratus rankNimbostratus
Jan 29, 2011

node names

Is there any way to get the node "name" in an iRule?

 

 

I have a rule that is currently putting the info from LB::server name

 

into a header for diagnostics, but I have a lot of nodes and would really like to be able to see the "screen" name of the node selected rather than its IP address.

 

in the conf they appear as:

 

node 192.168.0.100 {

 

screen webserver1

 

}

 

I'm looking to get that value "webserver1" to put in a header...

 

6 Replies

  • I did find this post that suggests doing a lookup on the IP. While not really desirable, I guess would work if there are no other options.
  • One option would be using a class/data group. You could create a relationship between the node's IP address and it's friendly name. What version are you using?

    An example for 10.1 and later would be to use class search - value.

    You'd define a string-type data group (named servernames below) where the field was 192.168.0.100 and value was webserver1. Then, you might use a rule like the following:

    
    when HTTP_REQUEST {
        HTTP::header insert "server_name"  [class search - value servernames eq [LB::server addr]]
     }
    

  • You could also open a request for enhancement with F5 Support for getting this functionality to get the node name added to iRules.

     

     

    Aaron
  • Posted By hoolio on 01/30/2011 10:22 PM

     

    You could also open a request for enhancement with F5 Support for getting this functionality to get the node name added to iRules.

     

     

    Aaron

     

    That would be much cooler. :-P
  • Posted By Chris Miller on 01/31/2011 06:27 AM

     

    Posted By hoolio on 01/30/2011 10:22 PM

     

    You could also open a request for enhancement with F5 Support for getting this functionality to get the node name added to iRules.

     

     

    Aaron

     

    That would be much cooler. :-P

     

    Agreed! But at least I have a couple of options... Thanks.

     

  • Did anything like this get implemented? It seems like the properties of the various "lists" (pools, nodes, etc) should be accessible from an iRule... maybe I'm just missing it?