mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-06 12:15:15 +00:00
28 lines
817 B
Lua
28 lines
817 B
Lua
--
|
|
-- (C) 2013-17 - ntop.org
|
|
--
|
|
|
|
dirs = ntop.getDirs()
|
|
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
|
|
|
require "lua_utils"
|
|
require "graph_utils"
|
|
require "historical_utils"
|
|
sendHTTPHeader('text/html; charset=iso-8859-1')
|
|
|
|
interface.select(ifname)
|
|
host_info = url2hostinfo(_GET)
|
|
|
|
stats = interface.getHostInfo(host_info["host"], host_info["vlan"])
|
|
|
|
|
|
if(stats ~= nil) then
|
|
local icmp = stats["ICMP"]
|
|
local tot = 0
|
|
|
|
for key, value in pairs(icmp) do
|
|
print('<tr><th>'..key..'</th><td align=right>'..formatPackets(value.sent).. '</td><td align=right>'..formatPackets(value.rcvd)..'</td><td>')
|
|
breakdownBar(value.sent, "Sent", value.rcvd, "Rcvd", 0, 100)
|
|
print("</td><td align=right>".. formatPackets(value.sent+value.rcvd) .."</td></tr>\n")
|
|
end
|
|
end
|