Forum Discussion
cat_13700
Nimbostratus
Mar 18, 2010Display name of pool member server
In the BIG-IP gui, when you're displaying members of the pool, you can see availability, ip and port, and the server name (in the column "node name"), among other things. I've found everything I need for my dashboard app, except the user-friendly server name. Where can i dig that up to display it in my app? Thanks for considering the question!
8 Replies
- Pool members themselves don't have user friendly names. That is an attribute of the NodeAddress. You'll need to look at the addresses for the pool members you are interested in and then query the LocalLB.NodeAddress.get_screen_name() method to query out the user friends names for those addresses.
http://devcentral.f5.com/wiki/default.aspx/iControl/LocalLB__NodeAddress__get_screen_name.html
Click here
Hope this helps!
-Joe - cat_13700
Nimbostratus
not having much luck here. i see that the get_screen_name function takes a string[] of node_addresses. Assuming those were just ip addresses i wrote the following:
string[] slist = new string[] { "111.11.101.001", "111.11.101.002" };
string[] sAdd = m_interfaces.LocalLBNodeAddress.get_screen_name(slist);
When I stop write there in debug and look at the contents of sAdd, I have an array with two elements = "".
So..how do i get my array of node_address? Or, if they are just ips, what am i doing wrong that the screen name doesn't appear?
I'm doing this inside my loop working with each pool member to get address, port, availability and enabled status. All others work great. - Have you ensured that those node addresses have an assigned screen name in the GUI? A screen name is something that has to be manually set.
Go into the Node Addresses section of the Admin GUI and look for "111.11.10.001" and look what shows up in the "Name" column. If there is a value there, then it should be what's returned for that entry in the list. If there is not an assigned screen name, then an empty string will be returned.
-Joe - cat_13700
Nimbostratus
yes server names display. other ideas? - cat_13700
Nimbostratus
I had a discussion with my network guy. He says the server name is only entered in one place. If i pick a local traffic pool and view the members in the console, i see me server name in the "node name" column. If i go to local traffic nodes and view the list, i see my servers and the server name shows up in the name column. If i click on one of my ips, I see the server name greyed out in the name box.
here is an extended bit of code. Please help me see what i'm doing wrong or what's missing from the configuration!//get list of members CommonIPPortDefinition [][] members = m_interfaces.LocalLBPool.get_member(new string[] {sPoolName}); for (int i = 0; i < members[0].Length; i++) { //get address and port sAddPort = members[0][ i ].address + ":" + members[0][ i ].port; //get enable status LocalLBPoolMemberMemberSessionState[][] sessionStates = m_interfaces.LocalLBPoolMember.get_session_enabled_state(new string[] { sPoolName }); bEnable = ParseState(sessionStates[0][ i ].session_state); //get avail status LocalLBPoolMemberMemberObjectStatus[][] objStatus = m_interfaces.LocalLBPoolMember.get_object_status(new string[] { sPoolName }); LocalLBAvailabilityStatus availability = objStatus[0][ i ].object_status.availability_status; sAvailable = ParseAvail((CommonAvailabilityStatus)availability); //get server name string[] nalist = new string[] { members[0][ i ].address }; string[] sAdd = m_interfaces.LocalLBNodeAddress.get_screen_name(nalist); //populate members listview { ListViewItem tempLvi = new ListViewItem(sAddPort); tempLvi.SubItems.Add(sAdd[0]); lvMembers1.Items.Add(tempLvi); } if (bEnable) lvMembers1.Items[ i ].Checked = true; if (sAvailable == "DOWN") { lvMembers1.Items[ i ].BackColor = Color.LightCoral; } }
(note: ParseEnable() and ParseAvail() just convert status to a boolean and availability to a string. - I don't see anything wrong with your code so there's not much I can do from my end to diagnose it further. I just wrote up some test code to verify that the methods worked. Could you test this console code out? It will query all the pools, then for each pool, query the pool members and the screen names for those members and then print it out to the console. If you are getting zero screen names in the output then there must be a bug on your version of BIG-IP.
namespace cstest { class Program { static void Main(string[] args) { iControl.Interfaces m_interfaces = new iControl.Interfaces(); m_interfaces.initialize("BIGIP_ADDRESS_GOES_HERE", "BIGIP_USER", "BIGIP_PASS"); String [] pool_list = m_interfaces.LocalLBPool.get_list(); iControl.CommonIPPortDefinition [][] member_listAofA = m_interfaces.LocalLBPool.get_member(pool_list); // Loop over pools for (int i = 0; i < member_listAofA.Length; i++) { int node_len = member_listAofA[ i ].Length; String[] node_addresses = new String[node_len]; for (int j = 0; j < node_len; j++) { node_addresses[j] = member_listAofA[ i ][j].address; } String[] screen_names = m_interfaces.LocalLBNodeAddress.get_screen_name(node_addresses); Console.WriteLine("POOL {0}", pool_list[ i ]); for (int j = 0; j < node_len; j++) { Console.WriteLine(" {0} -> '{1}'", node_addresses[j], screen_names[j]); } } } } }
You'll need to replace the parameters in the initialize method with your connection information. Let me know how this works out for you.
-Joe - Bummer man. It works fine for me on 10.1 and I know I've tested it on the 9.6 branch. You'll likely have to submit a support ticket on that one.
-Joe - cat_13700
Nimbostratus
SUCCESS!
We figured it out. The nodes are entered in the Common partition, but I'm restricted to the Alpha partition. All i had to do was add "m_interfaces.ManagementPartition.set_active_partition("Common")" before executing the get_screen_name command. Then of course reset it afterwards.
whew!
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
