mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Management framework: propagate metrics port from agent
This propagates the metrics port from the node config passed through the supervisor all the way into the script layer.
This commit is contained in:
parent
563704a26e
commit
fa6361af56
2 changed files with 11 additions and 3 deletions
|
@ -49,6 +49,8 @@ function __init_cluster_nodes(): bool
|
|||
@pragma pop ignore-deprecations
|
||||
if ( |manager_name| > 0 && cnode$node_type != Cluster::MANAGER )
|
||||
cnode$manager = manager_name;
|
||||
if ( endp?$metrics_port )
|
||||
cnode$metrics_port = endp$metrics_port;
|
||||
|
||||
Cluster::nodes[node_name] = cnode;
|
||||
}
|
||||
|
|
|
@ -520,6 +520,8 @@ function deploy_request_finish(areq: Management::Request::Request)
|
|||
|
||||
if ( node?$interface )
|
||||
cep$interface = node$interface;
|
||||
if ( node?$metrics_port )
|
||||
cep$metrics_port = node$metrics_port;
|
||||
|
||||
g_cluster[node$name] = cep;
|
||||
}
|
||||
|
@ -618,7 +620,8 @@ function get_nodes_request_finish(areq: Management::Request::Request)
|
|||
# the respective boot.zeek scripts).
|
||||
if ( node in sns$node$cluster )
|
||||
{
|
||||
cns$cluster_role = sns$node$cluster[node]$role;
|
||||
local cep: Supervisor::ClusterEndpoint = sns$node$cluster[node];
|
||||
cns$cluster_role = cep$role;
|
||||
|
||||
# For cluster nodes, copy run state from g_nodes, our
|
||||
# live node status table.
|
||||
|
@ -627,8 +630,11 @@ function get_nodes_request_finish(areq: Management::Request::Request)
|
|||
|
||||
# The supervisor's responses use 0/unknown to indicate
|
||||
# unused ports. (Prior to Zeek 7 this used to be 0/tcp.)
|
||||
if ( sns$node$cluster[node]$p != 0/unknown )
|
||||
cns$p = sns$node$cluster[node]$p;
|
||||
if ( cep$p != 0/unknown )
|
||||
cns$p = cep$p;
|
||||
|
||||
if ( cep?$metrics_port )
|
||||
cns$metrics_port = cep$metrics_port;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue