Forum Discussion

Sean_Ellis_9378's avatar
Sean_Ellis_9378
Icon for Nimbostratus rankNimbostratus
Oct 26, 2016

Python F5 Common SDK able to retrieve operations metrics?

I am working on replacing some legacy SSH+TMSH scripts, but have run into an issue using f5-common-python. I now have code to create and modify configuration, but need to view counters for profiles, pools, pool members and virtuals.

 

Commands I currently run to extract stats:

 

tmsh show /ltm profile tcp tcp.p-service raw (open, accepted, established, failed)
tmsh show /ltm profile http http.p-service raw (get, post, v10, v11, responses_by_size)
tmsh show /ltm virtual v.p-service.8443 raw (bits_in, bits_out, packets_in, packets_out, curr_conn, max_conn, total_conn, tot_requests)
tmsh show /ltm pool p.p-service.8443 raw (tot_requests, bits_in, bits_out, max_conn, tot_conn)
tmsh show /ltm pool p.p-service.8443 detail raw (tot_requests, bits_in, bits_out, max_conn, tot_conn)

Maybe it's just something simple I'm missing? Here is a representation of the programming.

 

    bigip = BigIP(job['hostname'], job['username'], job['password'])
    if bigip.ltm.pools.pool.exists(name=job['pool']):
        pool = bigip.ltm.pools.pool.load(name=job['pool'])
        for member in pool.members_s.get_collection():
            pprint.pprint(member.raw)
            pprint.pprint(dir(member))
        pprint.pprint(pool.raw)
        pprint.pprint(dir(pool))

Anyone have a direction to send me in? If the SDK cannot be used in this way, I can continue SSH+TMSH, via Paramiko. Thanks in advance.

 

No RepliesBe the first to reply