zeek/scripts/policy/frameworks/management/supervisor/api.zeek
Christian Kreibich 24a495da42 Management framework: Supervisor extensions for stdout/stderr handling
This improves the framework's handling of Zeek node stdout and stderr by
extending the (script-layer) Supervisor functionality.

- The Supervisor _either_ directs Zeek nodes' stdout/stderr to files _or_ lets
you hook into it at the script level. We'd like both: files make sense to allow
inspection outside of the framework, and the framework would benefit from
tapping into the streams e.g. for error context. We now provide the file
redirection functionality in the Supervisor, in addition to the hook
mechanism. The hook mechanism also builds up rolling windows of up to
100 lines (configurable) into stdout/stderr.

- The new Mangement::Supervisor::API::notify_node_exit event notifies
subscribers (agents, really) that a particular node has exited (and is possibly
being restarted by the Supervisor). The event includes the name of the node,
plus its recent stdout/stderr context.
2022-05-31 12:55:21 -07:00

18 lines
650 B
Text

@load policy/frameworks/management/types
module Management::Supervisor::API;
export {
## The Supervisor generates this event whenever it has received a status
## update from the stem, indicating that a node exited.
##
## node: the name of a node previously created via
## :zeek:see:`Supervisor::create`.
##
## outputs: stdout/stderr context for the node. The contained strings
## span up to the 100 most recent lines in the corresponding
## stream. See :zeek:see:`Management::Supervisor::output_max_lines`
## to adjust the line limit.
##
global notify_node_exit: event(node: string, outputs: Management::NodeOutputs);
}