The Monitor

aiomonitor.monitor

MONITOR_HOST = '127.0.0.1'

Specifies the default host to bind the services for the monitor

Warning

Since aiomonitor exposes the internal states of the traced process, never bind it to publicly accessible address to prevent potential security breaches and denial of services!

MONITOR_TERMUI_PORT = 20101

Specifies the default telnet port for teh monitor where you can connect using a telnet client

MONITOR_WEBUI_PORT = 20102

Specifies the default HTTP port for the monitor where you can connect using a web browser

CONSOLE_PORT = 20103

Specifies the default port for asynchronous python REPL

aiomonitor.monitor.start_monitor(loop, *, monitor_cls=<class 'aiomonitor.monitor.Monitor'>, host='127.0.0.1', port=20101, console_port=20103, webui_port=20102, console_enabled=True, hook_task_factory=False, max_termination_history=None, locals=None)[source]

Factory function, creates instance of Monitor and starts monitoring thread.

Parameters:
  • monitor (Type[Monitor]) – Monitor class to use

  • host (str) – hostname to serve monitor telnet server

  • port (int) – monitor port (terminal UI), by default 20101

  • webui_port (int) – monitor port (web UI), by default 20102

  • console_port (int) – python REPL port, by default 20103

  • console_enabled (bool) – flag indicates if python REPL is requred to start with instance of monitor.

  • locals (dict) – dictionary with variables exposed in python console environment

Return type:

Monitor

class aiomonitor.monitor.Monitor[source]
start()[source]

Starts monitoring thread, where telnet server is executed.

Return type:

None

close()[source]

Joins background thread, and cleans up resources.

Return type:

None

closed

A flag indicates if monitor was closed, currntly instance of Monitor can not be reused. For new monitor, new instance should be created.

prompt: str

The string that prompts you to enter a command, defaults to "monitor >>> "

property host: str

The current hostname to bind the monitor server.

property port: int

The port number to bind the monitor server.