Forum Discussion

Thiyagu's avatar
Icon for Cirrus rankCirrus
May 04, 2021

F5 SDK help to login to multiple devices to search for a pool member


Hello All,

I'm trying a lot for the automation. I'm finding a step to login to one device. I want my script to login to multiple device and to search for a pool member


Connect to the BigIP and configure the basic objectsmgmt = ManagementRoot("", "admin", "somepassword")


Could you please help how can I use python sdk to login to multiple devices?





1 Reply

  • Hello Thiyagu.

    Try this:

    from f5.bigip import ManagementRoot
    # ----------------------------------------------------------
    sessions = []
    devices = ["", ""]
    poolmember = "mymember"
    for device in devices:
        session = ManagementRoot(device,"username","password",token=True)
    for session in sessions:
        for pool in
            for member in pool.members_s.get_collection():
                if':')[0] == poolmember:
                    print("Pool member \"{}\" detected in {}".format(poolmember, session.hostname))