mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 02:28:21 +00:00
Generalize Cluster::worker_count.
This commit is contained in:
parent
379624404c
commit
3db8bb4a44
6 changed files with 62 additions and 47 deletions
|
@ -46,7 +46,8 @@ global sent_data = F;
|
|||
|
||||
event Cluster::node_up(name: string, id: string)
|
||||
{
|
||||
if ( Cluster::local_node_type() == Cluster::PROXY && Cluster::worker_count == 2 )
|
||||
if ( Cluster::local_node_type() == Cluster::PROXY &&
|
||||
Cluster::get_active_node_count(Cluster::WORKER) == 2 )
|
||||
{
|
||||
# Make the proxy tell the manager explicitly when both workers
|
||||
# have checked in. The cluster framework normally generates this
|
||||
|
@ -63,7 +64,8 @@ event Cluster::node_up(name: string, id: string)
|
|||
|
||||
# Insert data once both workers and the proxy are connected, and
|
||||
# the proxy has indicated that it too has both workers connected.
|
||||
if ( Cluster::worker_count == 2 && Cluster::proxy_pool$alive_count == 1 && proxy_ready )
|
||||
if ( Cluster::get_active_node_count(Cluster::WORKER) == 2 &&
|
||||
Cluster::proxy_pool$alive_count == 1 && proxy_ready )
|
||||
Intel::insert([$indicator="1.2.3.4", $indicator_type=Intel::ADDR, $meta=[$source="manager"]]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,8 @@ redef Log::default_rotation_interval=0sec;
|
|||
event Cluster::node_up(name: string, id: string)
|
||||
{
|
||||
# Insert the data once both workers are connected.
|
||||
if ( Cluster::local_node_type() == Cluster::MANAGER && Cluster::worker_count == 2 )
|
||||
if ( Cluster::local_node_type() == Cluster::MANAGER &&
|
||||
Cluster::get_active_node_count(Cluster::WORKER) == 2 )
|
||||
{
|
||||
Intel::insert([$indicator="1.2.3.4", $indicator_type=Intel::ADDR, $meta=[$source="manager"]]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue