Forum Discussion

uisomdc_95191's avatar
uisomdc_95191
Icon for Nimbostratus rankNimbostratus
Aug 08, 2008

qualifying node IP's to hostname

anyone know of a way to get this done inside the API? I'm going to need actual hostnames of my nodes displayed to people I'd like to avoid doing any nslookups within my code, but i can every hour and store them if need be.

 

 

LocalLB_NodeAddress. looked promising but I couldn't seem to get anything decent.

 

 

2 Replies

  • You can give user friendly names to NodeAddresses so you can easily accomplish the same thing by setting that property to the hostname of the node address. The problem is that this is only available in the NodeAddress interface, not the PoolMember.

     

     

    If you don't want to do nslookups locally, you can always do them with the System.Inet interface's ip_to_hostname() method - that is, if you have DNS setup correctly on your BIG-IP and you have DNS entries for all of your nodes.

     

     

    Here's a tech tip I wrote on the System.Inet interface:

     

     

    http://devcentral.f5.com/Default.aspx?tabid=63&articleType=ArticleView&articleId=191

     

    Click here

     

     

     

    -Joe
  • This is how I did it in Java:

     LocalLBPoolMemberBindingStub f5_pm_obj = (LocalLBPoolMemberBindingStub) new LocalLBPoolMemberLocator().getLocalLBPoolMemberPort(new URL(f5_address));  
     LocalLBNodeAddressBindingStub f5_na_obj = (LocalLBNodeAddressBindingStub) new LocalLBNodeAddressLocator().getLocalLBNodeAddressPort(new URL(f5_address));  
        
     LocalLBPoolMemberMemberSessionStatus[] serverStatuses = f5_pm_obj.get_session_status(new String[] {"pool_name"})[ 0 ];  
        
     nodeIndex = 0;        
     String nodeAddress = serverStatuses[nodeIndex].getMember().getAddress();  
     String hostname = f5_na_obj.get_screen_name(new String[] {nodeAddress})[ 0 ];