-- -- (C) 2013-16 - ntop.org -- dirs = ntop.getDirs() package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path if(ntop.isPro()) then package.path = dirs.installdir .. "/pro/scripts/lua/modules/?.lua;" .. package.path require "snmp_utils" end require "lua_utils" require "graph_utils" require "alert_utils" require "historical_utils" mac = _GET["mac"] vlanId = _GET["vlanId"] if(vlanId == nil) then vlanId = 0 end interface.select(ifname) ifstats = interface.getStats() ifId = ifstats.id prefs = ntop.getPrefs() sendHTTPHeader('text/html; charset=iso-8859-1') ntop.dumpFile(dirs.installdir .. "/httpdocs/inc/header.inc") dofile(dirs.installdir .. "/scripts/lua/inc/menu.lua") if(mac == nil) then print("
| MAC Address | "..mac) s = get_symbolic_mac(mac, true) if(s ~= mac) then print(" ("..s..")") end if(_GET["custom_name"] ~=nil) then setHostAltName(mac, _GET["custom_name"]) end if(_GET["custom_icon"] ~=nil) then setHostIcon(mac, _GET["custom_icon"]) end print(getHostIcon(mac)) local label = getHostAltName(mac) print(" [ Show Hosts ]") print(" | ") if(isAdministrator()) then print("") print [[ | ") end print("") print(" |
|---|---|---|
| First / Last Seen | " .. formatEpoch(mac_info["seen.first"]) .. " [" .. secondsToTime(os.time()-mac_info["seen.first"]) .. " ago]" .. " | \n") print("" .. formatEpoch(mac_info["seen.last"]) .. " [" .. secondsToTime(os.time()-mac_info["seen.last"]) .. " ago]" .. " |
| Sent vs Received Traffic Breakdown | ") breakdownBar(mac_info["bytes.sent"], "Sent", mac_info["bytes.rcvd"], "Rcvd", 0, 100) print(" | |
| Traffic Sent / Received | " .. formatPackets(mac_info["packets.sent"]) .. " / ".. bytesToSize(mac_info["bytes.sent"]) .. " | " .. formatPackets(mac_info["packets.rcvd"]) .. " / ".. bytesToSize(mac_info["bytes.rcvd"]) .. " |