base/frameworks/supervisor/control.zeek
- SupervisorControl
The Zeek process supervision (remote) control API. This defines a Broker topic prefix and events that can be used to control an external Zeek supervisor process. This API was introduced in Zeek 3.1.0 and considered unstable until 4.0.0. That is, it may change in various incompatible ways without warning or deprecation until the stable 4.0.0 release.
- Namespace:
SupervisorControl
- Imports:
Summary
Redefinable Options
When enabled, the Supervisor will listen on the configured Broker
|
|
The Broker topic prefix to use when subscribing to Supervisor API requests and when publishing Supervisor API responses. |
Events
Send a request to a remote Supervisor process to create a node. |
|
Handle a response from a Supervisor process that received
|
|
Send a request to a remote Supervisor process to destroy a node. |
|
Handle a response from a Supervisor process that received
|
|
A notification event the Supervisor generates when it receives a status message update from the stem, indicating node has (re-)started. |
|
Send a request to a remote Supervisor process to restart a node. |
|
Handle a response from a Supervisor process that received
|
|
Send a request to a remote Supervisor process to retrieve node status. |
|
Handle a response from a Supervisor process that received
|
|
Send a request to a remote Supervisor to stop and shutdown its process tree. |
Detailed Interface
Redefinable Options
- SupervisorControl::enable_listen
- Type:
- Attributes:
- Default:
F
- Redefinition:
from policy/frameworks/management/agent/boot.zeek
=
:T
When enabled, the Supervisor will listen on the configured Broker
Broker::default_listen_address
.
- SupervisorControl::topic_prefix
-
The Broker topic prefix to use when subscribing to Supervisor API requests and when publishing Supervisor API responses. If you are publishing Supervisor requests, this is also the prefix string to use for their topic names.
Events
- SupervisorControl::create_request
- Type:
event
(reqid:string
, node:Supervisor::NodeConfig
)
Send a request to a remote Supervisor process to create a node.
- Parameters:
reqid – an arbitrary string that will be directly echoed in the response
node – the desired configuration for the new supervised node process.
- SupervisorControl::create_response
-
Handle a response from a Supervisor process that received
SupervisorControl::create_request
.- Parameters:
reqid – an arbitrary string matching the value in the original request.
result – the return value of the remote call to
Supervisor::create
.
- SupervisorControl::destroy_request
-
Send a request to a remote Supervisor process to destroy a node.
- Parameters:
reqid – an arbitrary string that will be directly echoed in the response
node – the name of the node to destroy or empty string to mean “all nodes”.
- SupervisorControl::destroy_response
-
Handle a response from a Supervisor process that received
SupervisorControl::destroy_request
.- Parameters:
reqid – an arbitrary string matching the value in the original request.
result – the return value of the remote call to
Supervisor::destroy
.
- SupervisorControl::node_status
-
A notification event the Supervisor generates when it receives a status message update from the stem, indicating node has (re-)started. This is the remote equivalent of
Supervisor::node_status
.- Parameters:
node – the name of a previously created node via
Supervisor::create
indicating to which child process the stdout line is associated.pid – the process ID the stem reported for this node.
- SupervisorControl::restart_request
-
Send a request to a remote Supervisor process to restart a node.
- Parameters:
reqid – an arbitrary string that will be directly echoed in the response
node – the name of the node to restart or empty string to mean “all nodes”.
- SupervisorControl::restart_response
-
Handle a response from a Supervisor process that received
SupervisorControl::restart_request
.- Parameters:
reqid – an arbitrary string matching the value in the original request.
result – the return value of the remote call to
Supervisor::restart
.
- SupervisorControl::status_request
-
Send a request to a remote Supervisor process to retrieve node status.
- Parameters:
reqid – an arbitrary string that will be directly echoed in the response
node – the name of the node to get status of or empty string to mean “all nodes”.
- SupervisorControl::status_response
- Type:
event
(reqid:string
, result:Supervisor::Status
)
Handle a response from a Supervisor process that received
SupervisorControl::status_request
.- Parameters:
reqid – an arbitrary string matching the value in the original request.
result – the return value of the remote call to
Supervisor::status
.
- SupervisorControl::stop_request
- Type:
event
()
Send a request to a remote Supervisor to stop and shutdown its process tree. There is no response to this message as the Supervisor simply terminates on receipt.