Forum Discussion
Configuration script to get the uptime of all LTM
Hello All, I'm working on a task to get the uptime of all LTM in the Datacenters for every year.
I'm looking for a python script which will would help me to login and get the uptime of all LTM.
Could you please help me on this to move in the correct direction?
Regards, Thiyagu
1 Reply
This post shows some python code to get you going.
https://devcentral.f5.com/questions/native-tmsh-bash-commands-via-rest-api-51343
I tested it myself and it seems to work. I added an extra print(result.content) after the print("ok").
[nielsvs@localhost python]$ python run_bash_command.py ok {"kind":"tm:util:bash:runstate","utilCmdArgs":"-c 'uptime'","command":"run","commandResult":" 17:16:07 up 11 min, 0 users, load average: 1.84, 2.55, 1.83\n"} [nielsvs@localhost python]$
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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