Forum Discussion
L4L7_53191
Aug 07, 2009Nimbostratus
Sam, I'll put another vote in for your approach - I really think this will work well, or at least it'll give you all of the data you need to figure this out programatically.
😧 I'm not clear at all as to why Sam's original method wouldn't work here...sorry if I am missing something, but to reiterate:
1) Discover units - if there's something listening on 443 and it's got a valid iControl URI you can assume it's a BigIP. Hit it via iControl and do a get_version() to be certain.
2) Interrogate Self-IP information on the unit using the calls Sam outlines above. Stuff this info into a structure that you can build/compare against other systems.
Once you build a structure you can go nuts with comparisons intersections, etc. Here's an example of building a Python dictionary (or perl hash, etc) from the pertinent info:
In [20]: self_ips1 = b.Networking_SelfIP.get_list()['return']
In [26]: print self_ips1
['10.0.0.90', '172.16.1.1', '172.16.1.2']
In [27]: floating_ips1 = b.Networking_SelfIP.get_floating_state(self_ips = self_ips1)['return']
In [28]: combined = dict(zip(self_ips1, floating_ips1))
In [30]: print combined
{'172.16.1.2': 'STATE_DISABLED', '10.0.0.90': 'STATE_DISABLED', '172.16.1.1': 'STATE_ENABLED'}
...then build your other data structure, and:
In [33]: '172.16.1.1' in combined2.keys()
Out[33]: True
So we now know that these two units share 172.16.1.1, and are therefore a pair...this should get you very close, no?
-Matt