- Linux path to script:
/usr/share/reven/examples/monitor_status_servers.py
- Windows path to script:
- amd64:
C:\Program Files (x86)\Reven-PythonAPI-amd64\python-examples\monitor_status_servers.py
- x86:
C:\Program Files (x86)\Reven-PythonAPI-x86\python-examples\monitor_status_servers.py
This shows how to monitor the status of the running servers. See this page for more information.
6 launcher = reven_api.launcher_connection(host, 8080)
9 def get_execution_status(host, port):
11 project = reven.Project(host, port)
12 return project.execution_status()
13 except reven.reven_api.LicenseError
as le:
15 return reven.ExecutionProgress.from_license_error(le)
17 def print_status_servers(launcher):
18 for server
in launcher.list_servers():
19 project = server.project
20 port = server.reven_server.port
22 status = get_execution_status(host, port)
23 print(
"{} on {}: {}".format(project, port, status))
24 except RuntimeError
as re:
25 print(
"{} on {}: an error occurred ({})".format(project, port, re))
28 print_status_servers(launcher)
30 time.sleep(sleep_duration)