Forum Discussion
Cynthia_18735
Nimbostratus
May 06, 2008More efficient way to get pool member status per URL using iControl?
I have a perl script that is does the following:
(1) Gets a list of WideIP's from GlobalLB/WideIP
(2) For each WideIP, gets a list of Pool names from GlobalLB/Pool.
Input is an array of WideIP's (from 1)
(3) For each pool name in each WideIP, gets a list of pool members from GlobalLB/PoolMember:
Input is an array with a single pool name.
Output is address and port.
(4) For each address:port in each pool gets enabled/disabled state from GlobalLB/VirtualServer
Inut an Array with a single address and port
for each pool member
Output is enabled/disabled state.
So, this processes as follows:
- Retrieve WideiP list
Start Loop 1:
For each WideIP --> get poolnames
Start Loop 2:
For each Poolname
--> get poolmembers
Start Loop 3:
For each poolmember
--> get VirtualServer states
End Loop 3
End Loop 2
End Loop 1
This results in many HTTP/Soap requests hitting the GTM very quickly. Is there a better way to do this?
- First off, thanks for the amount of detail, that makes things eaasier on this end. Second, why are you getting the enabled state from the GlobalLB.VirtualServer interface? Since you are querying Pool Members, wouldn't you want to use the GlobalLB.PoolMember interface to get those enabled states? I'm going to proceed assuming that you want to use the PoolMember states. If you really want to use those pool members as virtual server states, then just change step 4.
- Cynthia_18735
Nimbostratus
Joe, thank you very much for the quick response. I will give your sugggestions a try. I'm not too great at coding complex perl structures, but will see what I can do. I'll let you know how it works out. Thanks again! - Cynthia_18735
Nimbostratus
Joe - I made some progress; however, am having a problem with the following: - The method prototype is the following:
MemberObjectStatus [] [] GlobalLB.PoolMember.get_object_status( in String [] pool_names, in Common__IPPortDefinition [] [] members );
$members = { address => $address, port => $port }; push @List, $members; push @Lists, @List $soapResponse = $POOLMEMBER->get_object_status( SOAP::Data->name(pool_names => [ @mpools ]), SOAP::Data->name(members => [ @Lists ]) );
- Cynthia_18735
Nimbostratus
I think I am getting close, but just not quite there yet. I did your suggestion with @List and @Lists variables. @Lists only gets pushed to once for each pool. But, the call still isn't returning anything. I must be missing something. I don't understand why @Lists would still list 8 hashes, when I think, it should only list 4 (one hash for each pool, right?) - Can you post your code and I'll take a look.
- Cynthia_18735
Nimbostratus
Joe - I got it working. I had a problem with the structure for 'members', but looked through some code posted to this site, and got the problem resolved. The script is working as expected, and we're putting it through some testing this morning, and should be able to move the changes to our prod enviornment later today. Thanks again for your asistance with this and all of the good suggestions!! I really appreciate it. - The dynamic languages like Perl and Python are always the hardest to get off the ground running with more complex parameters.
- Cynthia_18735
Nimbostratus
Joe - I have moved this code into production, and seems to be working just great! Just one more question though. - Don_MacVittie_1Historic F5 AccountHey Cynthia,
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