elastic_82555
Sep 24, 2013Nimbostratus
Solved
Retrieving VS, pool, and nodes from F5
Hi, Using Chef extensively internally, and now would like to take all the node ip's(hostnames) out of chef, then programatically(using RESTful) interface, query the F5, to retrieve the nodes, pool and untimately the VS ip address. This will allow me to dynamically build a page which can be updated in real-time to allow us a dynamic view of our current network, which will give front end VS(dns/ip's), back end nodes(dns/ip's), then we can populate this further with metadata from chef.
For now I have been able to pull a list of all front end VS, and all node ip's. But I am having serious problems trying to successfully get a mapping from node to VS. Probably I need to iterate over all the pools, but I am unable to get a list of all the pools, for now only a subset....eg...
curl -k -u admin:password -H "Content-Type: application/json" -X GET https://192.168.1.1/mgmt/tm/ltm/pool?\$expand=* |python -m json.tool</mypassword>
`
This only returns 6 items, basically only "objects"(sorry on terminology), that appear at the root of the /common partition. It does not appear to go down further. I have over 50 pools, but seem only to be able to list pools with no path eg /common = OK, /common/Myapp will not display. I am happy to iterate over them, but for that I would need to understand how to get a list to iterate over in the first place.
` Would be happy to do this over iControl soap interface instead, if that is easier, but the RESTful interface just seems easier.
Any help or advice greatly appreciated.
Sc0tt...
Example Python code:
try: logging.info("Connecting to BIG-IP and pulling statistics...") b = bigsuds.BIGIP(hostname=ltm_host, username=user, password=password) logging.info("Requesting session...") b = b.with_session_id() except bigsuds.Connecti , detail: logging.critical("Unable to connect to BIG-IP. Details: %s" % pformat(detail)) sys.exit(1) logging.info("Setting recursive query state to enabled...") b.System.Session.set_recursive_query_state(state='STATE_ENABLED') logging.info("Switching active folder to root...") b.System.Session.set_active_folder(folder="/")