cancel
Showing results for 
Search instead for 
Did you mean: 
Login & Join the DevCentral Connects Group to watch the Recorded LiveStream (May 12) on Basic iControl Security - show notes included.

Problem this snippet solves:

I spent a bit of time trying to get this to work. Delivering the data in the correct format to the get_member_session_status method took me a while, so I thought I would post my solution.

Code :

#!/usr/bin/env python
import sys
import bigsuds

def get_pools(obj):
    try:
        return obj.LocalLB.Pool.get_list()
    except Exception, e:
        print e
def get_members(obj, pool):
    try:
        return pool, obj.LocalLB.Pool.get_member_v2(pool)
    except Exception, e:
        print e
def get_status(obj, pool):
    try:
        return obj.LocalLB.Pool.get_member_session_status(pool)
    except Exception, e:
        print e
try:
    b = bigsuds.BIGIP(
            hostname = “”,
            username = "admin",
            password = “admin”,
            )
except Exception, e:
    print e
pools = get_pools(b)
members = get_members(b, pools)
for pool in pools:
    print "Pool:  %s" % pool
    members = b.LocalLB.Pool.get_member_v2([pool])
    status = b.LocalLB.Pool.get_member_session_status([pool], members)
    print "\tMembers:"
    for members, status in zip(members, status):
        count = 0
        while count < len(members):
            print "\t\tHost: %s\tState: %s" % (members[count]["address"], status[count])
            count += 1

Tested this on version:

11.6
Comments
Robert_47833
Altostratus
Altostratus
ha, I catch u eventually
John_Heyer_1508
Cirrostratus
Cirrostratus
Note that this will only show the admin status of each member. To get the healthcheck status, use: b.LocalLB.Pool.get_member_monitor_status([pool], members)
Geoff_34657
Nimbostratus
Nimbostratus
How hard would it be to make this a webpage? I am happy I can see this information but, when you have a hundred pools and hundreds of nodes it just scrolls through the screen. I have just started working with psp but, it doesn't seem that this easily translates to that type.
Version history
Last update:
‎19-Aug-2015 01:14
Updated by:
Contributors