Forum Discussion
Rob_74473
Cirrus
Apr 25, 2018Get list of monitors through SDK
I am trying to mimic the Health Monitors section from a pool properties page from the BigIP gui. I need to get a list of all monitors so I can construct a select field in a web page. I have tried sev...
Satoshi_Toyosa1
Apr 26, 2018Ret. Employee
From tmsh, type list ltm monitor and TAB completion. You will find the list of monitor types.
In iControl REST, the /mgmt/tm/ltm/monitor returns a list of objects. Each object represents the endpoint for a type: e.g.,
{
"reference": {
"link": "https://localhost/mgmt/tm/ltm/monitor/diameter?ver=13.1.0"
}
},
For curl users, it's as simple as grepping the link lines:
curl -sku admin: https://localhost/mgmt/tm/ltm/monitor | python -m json.tool | grep link
In Python API, the object is represented as dict, so you can do something like this:
from f5.bigip import ManagementRoot
mgmt = ManagementRoot('mgmtPort', 'user', 'pass')
monitor = mgmt.tm.ltm.monitor.get_collection()
for t in monitor:
print(t['reference']['link'])
You can use the link value as is to obtain the monitors under a specific type.
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