mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Implement host TCP flags distribution
This commit is contained in:
parent
e38fa8b7a1
commit
a439d9c2bd
5 changed files with 39 additions and 8 deletions
|
|
@ -17,14 +17,19 @@ host_info = url2hostinfo(_GET)
|
|||
local is_host
|
||||
|
||||
if(host_info["host"] ~= nil) then
|
||||
local breakdown = {}
|
||||
|
||||
-- Show ARP sent/recv breakdown
|
||||
stats = interface.getMacInfo(host_info["host"], host_info["vlan"])
|
||||
local arp_sent = stats["arp_requests.sent"] + stats["arp_replies.sent"]
|
||||
local arp_rcvd = stats["arp_requests.rcvd"] + stats["arp_replies.rcvd"]
|
||||
|
||||
local breakdown = {}
|
||||
breakdown[#breakdown + 1] = {label=i18n("sent"), value=arp_sent}
|
||||
breakdown[#breakdown + 1] = {label=i18n("received"), value=arp_rcvd}
|
||||
if stats ~= nil then
|
||||
local arp_sent = stats["arp_requests.sent"] + stats["arp_replies.sent"]
|
||||
local arp_rcvd = stats["arp_requests.rcvd"] + stats["arp_replies.rcvd"]
|
||||
|
||||
breakdown[#breakdown + 1] = {label=i18n("sent"), value=arp_sent}
|
||||
breakdown[#breakdown + 1] = {label=i18n("received"), value=arp_rcvd}
|
||||
end
|
||||
|
||||
print(json.encode(breakdown, nil))
|
||||
else
|
||||
-- Show ARP stats for interface
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue