mirror of
https://github.com/zeek/zeek.git
synced 2025-10-11 19:18:19 +00:00
Fixing control frameworks net_stats and peer_status commands.
Turns out the code implementing them went missing with the recent merge of the stats changes. For peer status, I removed most of the numbers that the code used to return because (1) we don't have access to that data anymore, and (2) even in 2.4 the numbers returned already didn't make sense (because they were global values, not per peer). We could consider just removing the peer_status command at all.
This commit is contained in:
parent
7c1aab0ce5
commit
e2dee49fc1
2 changed files with 17 additions and 1 deletions
|
@ -1 +1 @@
|
|||
Subproject commit 6f12b4da74e9e0885e1bd8cb67c2eda2b33c93a5
|
||||
Subproject commit 2d6caeacead070a6e12524bedebaf95f9f444bc6
|
|
@ -22,10 +22,26 @@ event Control::id_value_request(id: string)
|
|||
|
||||
event Control::peer_status_request()
|
||||
{
|
||||
local status = "";
|
||||
for ( p in Communication::nodes )
|
||||
{
|
||||
local peer = Communication::nodes[p];
|
||||
if ( ! peer$connected )
|
||||
next;
|
||||
|
||||
status += fmt("%.6f peer=%s host=%s\n",
|
||||
network_time(), peer$peer$descr, peer$host);
|
||||
}
|
||||
|
||||
event Control::peer_status_response(status);
|
||||
}
|
||||
|
||||
event Control::net_stats_request()
|
||||
{
|
||||
local ns = get_net_stats();
|
||||
local reply = fmt("%.6f recvd=%d dropped=%d link=%d\n", network_time(),
|
||||
ns$pkts_recvd, ns$pkts_dropped, ns$pkts_link);
|
||||
event Control::net_stats_response(reply);
|
||||
}
|
||||
|
||||
event Control::configuration_update_request()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue