Skip to content

phc2sys_monitor_task

Monitor task for phc2sys systemd units.

Classes:

Phc2SysMonitorTask

Phc2SysMonitorTask(unit_name: str, hostname: str)

Bases: MonitorTask

Monitor task for a phc2sys systemd unit.

Parameters:

  • unit_name (str) –

    The systemd unit name to monitor.

  • hostname (str) –

    The local hostname.

Raises:

Methods:

  • __str__

    Return a string representation of the task.

  • phc2sys_to_graph_updates

    Convert a phc2sys state change to graph updates.

  • poll

    Poll journal for updates, yielding graph updates.

  • run_loop

    Run the polling loop at the specified period.

  • stop

    Stop the monitoring loop.

__str__

__str__() -> str

Return a string representation of the task.

phc2sys_to_graph_updates

phc2sys_to_graph_updates(
    state_change: SystemdUnitStateChange,
)

Convert a phc2sys state change to graph updates.

poll async

poll()

Poll journal for updates, yielding graph updates.

run_loop async

run_loop(period_s: float)

Run the polling loop at the specified period.

stop

stop()

Stop the monitoring loop.