mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 09:38:19 +00:00
Merge branch 'topic/christian/node-status-notification'
* topic/christian/node-status-notification: Add Supervisor::node_status notification event
This commit is contained in:
commit
93bed5a261
11 changed files with 103 additions and 1 deletions
|
@ -150,4 +150,15 @@ export {
|
|||
##
|
||||
## msg: line-buffered contents from the stderr of a child process.
|
||||
global stderr_hook: hook(node: string, msg: string);
|
||||
|
||||
## A notification event the Supervisor generates when it receives a
|
||||
## status message update from the stem, indicating node has
|
||||
## (re-)started.
|
||||
##
|
||||
## node: the name of a previously created node via
|
||||
## :zeek:see:`Supervisor::create` indicating to which
|
||||
## child process the stdout line is associated.
|
||||
##
|
||||
## pid: the process ID the stem reported for this node.
|
||||
global node_status: event(node: string, pid: count);
|
||||
}
|
||||
|
|
|
@ -91,4 +91,16 @@ export {
|
|||
## process tree. There is no response to this message as the Supervisor
|
||||
## simply terminates on receipt.
|
||||
global SupervisorControl::stop_request: event();
|
||||
|
||||
## 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
|
||||
## :zeek:see:`Supervisor::node_status`.
|
||||
##
|
||||
## node: the name of a previously created node via
|
||||
## :zeek:see:`Supervisor::create` indicating to which
|
||||
## child process the stdout line is associated.
|
||||
##
|
||||
## pid: the process ID the stem reported for this node.
|
||||
global SupervisorControl::node_status: event(node: string, pid: count);
|
||||
}
|
||||
|
|
|
@ -99,3 +99,12 @@ event SupervisorControl::restart_request(reqid: string, node: string)
|
|||
local topic = SupervisorControl::topic_prefix + fmt("/restart_response/%s", reqid);
|
||||
Broker::publish(topic, SupervisorControl::restart_response, reqid, res);
|
||||
}
|
||||
|
||||
event Supervisor::node_status(node: string, pid: count)
|
||||
{
|
||||
if ( ! Supervisor::is_supervisor() )
|
||||
return;
|
||||
|
||||
local topic = SupervisorControl::topic_prefix + "/node_status";
|
||||
Broker::publish(topic, SupervisorControl::node_status, node, pid);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue