Management framework: establish stdout/stderr files also for cluster nodes

This commit is contained in:
Christian Kreibich 2022-05-18 18:21:21 -07:00
parent da016b8a68
commit e305d9c613
4 changed files with 24 additions and 0 deletions

View file

@ -4,6 +4,8 @@
##! ##!
##! If the current process is not the Zeek supervisor, this does nothing. ##! If the current process is not the Zeek supervisor, this does nothing.
@load base/utils/paths
@load ./config @load ./config
# The agent needs the supervisor to listen for node management requests. We # The agent needs the supervisor to listen for node management requests. We

View file

@ -4,6 +4,8 @@
##! supervisor. ##! supervisor.
@load base/frameworks/broker @load base/frameworks/broker
@load base/utils/paths
@load policy/frameworks/management @load policy/frameworks/management
@load policy/frameworks/management/node/api @load policy/frameworks/management/node/api
@load policy/frameworks/management/node/config @load policy/frameworks/management/node/config
@ -204,6 +206,11 @@ event Management::Agent::API::set_configuration_request(reqid: string, config: M
# node. # node.
nc$scripts[|nc$scripts|] = "policy/frameworks/management/node"; nc$scripts[|nc$scripts|] = "policy/frameworks/management/node";
if ( Management::Node::stdout_file != "" )
nc$stdout_file = Management::Node::stdout_file;
if ( Management::Node::stderr_file != "" )
nc$stderr_file = Management::Node::stderr_file;
# XXX could use options to enable per-node overrides for # XXX could use options to enable per-node overrides for
# directory, stdout, stderr, others? # directory, stdout, stderr, others?

View file

@ -5,6 +5,8 @@
##! ##!
##! If the current process is not the Zeek supervisor, this does nothing. ##! If the current process is not the Zeek supervisor, this does nothing.
@load base/utils/paths
@load ./config @load ./config
event zeek_init() event zeek_init()

View file

@ -6,4 +6,17 @@ export {
## The nodes' Broker topic. Cluster nodes automatically subscribe ## The nodes' Broker topic. Cluster nodes automatically subscribe
## to it, to receive request events from the Management framework. ## to it, to receive request events from the Management framework.
const node_topic = "zeek/management/node" &redef; const node_topic = "zeek/management/node" &redef;
## Cluster node stdout log configuration. If the string is non-empty,
## Zeek will produce a free-form log (i.e., not one governed by Zeek's
## logging framework) in the node's working directory. If left empty, no
## such log results.
##
## Note that cluster nodes also establish a "proper" management log via
## the :zeek:see:`Management::Log` module.
const stdout_file = "stdout" &redef;
## Cluster node stderr log configuration. Like
## :zeek:see:`Management::Node::stdout_file`, but for the stderr stream.
const stderr_file = "stderr" &redef;
} }