Forum Discussion
Alexander_Stewa
Nimbostratus
May 02, 2007Help with PoolMember get_object_status on dozens of pools
So I'm writing an iControl program in perl that essentially recreates the network map that was the main page of BigIP 4.x I have the following working:
All VIPs
Status of all VIPs
All Pools in...
Sep 13, 2007
First of all, I modified your post to for formatting (hope you don't mind...). bracket-i-closebracket is formatted as an italic in our forum code.
Now for your issue...
Errors like "Could not find element by name" implies either 1) a serialization error on the client (most prevalent in dynamic languages like perl) or 2) a null element where a value was expected. The "address" field is most likely from the IPPortDefinition structure in the members parameter to get_object_status(). That would mean that you have some null fields in there.
Taking a look at your code where you are allocating and filling in the "info" member, I noticed something odd:
iControl.CommonIPPortDefinition [][] info;
info = new iControl.CommonIPPortDefinition[pools.length][];
iControl.GlobalLBPoolPoolMemberDefinition[][] members= globalLBActivateNode.getPoolMember(pools);
for(int i=0;i info[ i ] = new iControl.CommonIPPortDefinition[i+1];
for(int j=0;j ipaddress=members[ i ][ j ].getMember();
// Fill the array with the CommonIPPortDefinition
info[ i ][ j ] = new iControl.CommonIPPortDefinition(ipaddress.getAddress(),ipaddress.getPort());
}
}
The line where you are allocating the 2nd dimension of the info array index i, you are allocating it to a size of i+1, but then you are entering a for loop from 0 to members[ i ].length-1. I think those two values should be the same. Odds are that i+1 will not always equal the members[ i ].length. I'm surprised you didn't get a runtime violation for the case when members[ i ].length was greater than i+1.
I'd change your code to this and see if it fixes things up.
iControl.CommonIPPortDefinition [][] info;
info = new iControl.CommonIPPortDefinition[pools.length][];
iControl.GlobalLBPoolPoolMemberDefinition[][] members= globalLBActivateNode.getPoolMember(pools);
for(int i=0;i info[ i ] = new iControl.CommonIPPortDefinition[members[ i ].length];
for(int j=0;j ipaddress=members[ i ][ j ].getMember();
// Fill the array with the CommonIPPortDefinition
info[ i ][ j ] = new iControl.CommonIPPortDefinition(ipaddress.getAddress(),ipaddress.getPort());
}
}
I'm not sure this will totally fix your issue, but odds are it will get you going in the right direction.
Let me know if this does or doesn't work and I'll dig into it some more...
-Joe
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
