Forum Discussion
JRM
Nimbostratus
Nov 22, 2010C# iControl WideIP to LTM Pool
We have GTM devices in several datacenters and when trying to find out where a website is active it sometimes takes a few clicks to get the data - and it isn't in one view. So I was trying to make a little web page to show GTM WIP --> GTM Pool --> Server Name / Datacenter --> LTM Virtual Server --> LTM Pool. Eventually I would like to have the ratio at the GTM level if I am split between datacenters instead of 100% traffic to one datacenter.
I have some working code, but I am sure there is a much more efficient way to do what I am trying to do, so I am just looking for a better way to get information for a specific Wide IP pool - specifically searching for just one instead of iterating through all of them and can I get back the "Server Name" and "Data Center" fields. Also the same applies at the pool level.
My output (pre-formatting) is like this:
Info: datacenter1-external-ltm1 datacenter1-internal-ltm1 gtm_pool gtm_datacenter ltm_pool_the_VS_points_To
Thanks
Code attached:
3 Replies
- That's going to take some time for me to dig through your code. Is it working for you and you are just looking for ways to optimize it?
-Joe - JRM
Nimbostratus
Joe,
Correct. I want to optimize it and make it a little more flexible. This also seemed like a good example to learn about how to get data for just one WIP/VS/Pool.
In the long run I want to be able to take my WideIP, show what Pool it goes to and show the ratio between DataCenters.
What I am trying to improve I think is as follows:
1) Put in the WIP and get the pool it points to (right now I know what pool is used for the WIP so I hard coded it to just look at the pool)
2) Get the GTM/LTM pool directly instead of getting all pools and iterating through them to find just the one I want to look at
3) Find out how to access the 'Server Name' and 'Data Center' values that I see in the GTM for the GTM Pool (this is on 10.2)
So although a working example would be great I think I can put something together if I can just figure out which functions I should use for the above or if I can even get back the values easily.
I am thinking eventually I would look for output something like this (assume I send it the WIP mytest.com)
WIP: mytest.com
--> GTM Pool: pool_mytest
--->DataCenter1 - Ratio X
-----> LTM Virtual Server: vip_web_mytest
---------> LTM Pool: ltm_pool_mytest
--> DataCenter2 - Ratio Y
----> LTM Virtual Server: vip_web_mytest
---------> LTM Pool: ltm_pool_mytest
I hope that makes more sense.
Thanks
Jason - JRM
Nimbostratus
For the first part I can get just the Wide IP Pool -
string[] wip = new string[] { "www.mysite.com" };
string[] wip_pool = new string[] { vs_wip[0][0].pool_name.toString() };
iControl.globalLBPoolPoolMemberDefinition[][] pool_members = m_interfaces.GlobalLBPool.get_member(wip_pool);
string p_addr = pool_members[0][0].member.address;
However from this point I am still not sure how to get the additional information for the member - namely the member name, server name and data center values that are listed in the web GUI for the pool. I am thinking this is more of a calculated value than a property of the pool, but looking through the API guide I don't see any place that this is exposed. It looks like I would have to query every LTM to find the member.address.
So I think that I have my first two goals covered but still not seeing in the API guide how to get the above data easily.
Thanks
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