Forum Discussion
Thiyagu
Cirrus
May 04, 2021F5 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 BigI...
Dario_Garrido
Noctilucent
May 17, 2021Hello Thiyagu.
Try this:
from f5.bigip import ManagementRoot
# ----------------------------------------------------------
sessions = []
devices = ["bigip1.example.com", "bigip2.example.com"]
poolmember = "mymember"
for device in devices:
session = ManagementRoot(device,"username","password",token=True)
sessions.append(session)
for session in sessions:
for pool in session.tm.ltm.pools.get_collection():
for member in pool.members_s.get_collection():
if member.name.split(':')[0] == poolmember:
print("Pool member \"{}\" detected in {}".format(poolmember, session.hostname))
Regards,
Dario.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects