mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-12 12:41:16 +00:00
Added ability to report ZMQ bps/pps as exported in latest nProbe
This commit is contained in:
parent
08c908be2f
commit
89ea597be3
5 changed files with 22 additions and 11 deletions
|
|
@ -434,7 +434,7 @@ u_int8_t ParserInterface::parseEvent(char *payload, int payload_size, u_int8_t s
|
|||
char remote_ifname[32] = { 0 }, remote_ifaddress[64] = { 0 };
|
||||
char remote_probe_address[64] = { 0 }, remote_probe_public_address[64] = { 0 };
|
||||
u_int64_t remote_bytes = 0, remote_pkts = 0;
|
||||
u_int32_t remote_ifspeed = 0, remote_time = 0;
|
||||
u_int32_t remote_ifspeed = 0, remote_time = 0, avg_bps = 0, avg_pps = 0;
|
||||
|
||||
while(!json_object_iter_equal(&it, &itEnd)) {
|
||||
const char *key = json_object_iter_peek_name(&it);
|
||||
|
|
@ -453,17 +453,21 @@ u_int8_t ParserInterface::parseEvent(char *payload, int payload_size, u_int8_t s
|
|||
else if(!strcmp(key, "probe.public_ip")) snprintf(remote_probe_public_address, sizeof(remote_probe_public_address), "%s", value);
|
||||
else if(!strcmp(key, "bytes")) remote_bytes = atol(value);
|
||||
else if(!strcmp(key, "packets")) remote_pkts = atol(value);
|
||||
else if(!strcmp(key, "time")) remote_time = atol(value);
|
||||
else if(!strcmp(key, "time")) remote_time = atol(value); /* Format 1461424017.299 <sec>.<msec> */
|
||||
else if(!strcmp(key, "avg.bps")) avg_bps = atol(value);
|
||||
else if(!strcmp(key, "avg.pps")) avg_pps = atol(value);
|
||||
|
||||
/* Move to the next element */
|
||||
json_object_iter_next(&it);
|
||||
}
|
||||
} // while json_object_iter_equal
|
||||
|
||||
/* Process Flow */
|
||||
/* ntop->getTrace()->traceEvent(TRACE_WARNING, "%u/%u", avg_bps, avg_pps); */
|
||||
|
||||
/* Process Flow */
|
||||
iface->setRemoteStats(remote_ifname, remote_ifaddress, remote_ifspeed,
|
||||
remote_probe_address, remote_probe_public_address,
|
||||
remote_bytes, remote_pkts, remote_time);
|
||||
remote_bytes, remote_pkts, remote_time, avg_pps, avg_bps);
|
||||
|
||||
/* Dispose memory */
|
||||
json_object_put(o);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue