-- -- (C) 2013-17 - 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" local host_pools_utils = require "host_pools_utils" local host_info = url2hostinfo(_GET) mac = host_info["host"] vlanId = host_info["vlan"] if(vlanId == nil) then vlanId = 0 end interface.select(ifname) ifstats = interface.getStats() ifId = ifstats.id prefs = ntop.getPrefs() sendHTTPContentTypeHeader('text/html') ntop.dumpFile(dirs.installdir .. "/httpdocs/inc/header.inc") dofile(dirs.installdir .. "/scripts/lua/inc/menu.lua") if(mac == nil) then print("
| "..i18n("mac_address").." | "..mac) s = get_symbolic_mac(mac, true) if(s ~= mac) then print(" ("..s..")") end if(_POST["custom_name"] ~=nil) then setHostAltName(mac, _POST["custom_name"]) end if(_POST["custom_icon"] ~=nil) then setHostIcon(mac, _POST["custom_icon"]) end print(getHostIcon(mac)) local label = getHostAltName(mac) if mac_info["num_hosts"] > 0 then print(" [ "..i18n("details.show_hosts").." ]") end print(" | ") if(isAdministrator()) then print("") print [[ | ") end print("") if isAdministrator() then local pool_id = nil if (_POST["pool"] ~= nil) then pool_id = _POST["pool"] local prev_pool = host_pools_utils.getMacPool(mac) if pool_id ~= prev_pool then local key = mac if not host_pools_utils.changeMemberPool(ifId, key, pool_id) then pool_id = nil else interface.reloadHostPools() end end end if (pool_id == nil) then pool_id = host_pools_utils.getMacPool(mac) end if not ifstats.isView then printPoolChangeDropdown(pool_id) end end print(" |
|---|---|---|
| ".. i18n("details.first_last_seen") .. " | " .. formatEpoch(mac_info["seen.first"]) .. " [" .. secondsToTime(os.time()-mac_info["seen.first"]) .. " " .. i18n("details.ago").."]" .. " | \n") print("" .. formatEpoch(mac_info["seen.last"]) .. " [" .. secondsToTime(os.time()-mac_info["seen.last"]) .. " " .. i18n("details.ago").."]" .. " |
| " .. i18n("details.sent_vs_received_traffic_breakdown") .. " | ") breakdownBar(mac_info["bytes.sent"], i18n("sent"), mac_info["bytes.rcvd"], i18n("details.rcvd"), 0, 100) print(" | |
| " .. i18n("details.traffic_sent_received") .. " | " .. formatPackets(mac_info["packets.sent"]) .. " / ".. bytesToSize(mac_info["bytes.sent"]) .. " | " .. formatPackets(mac_info["packets.rcvd"]) .. " / ".. bytesToSize(mac_info["bytes.rcvd"]) .. " |
| ]]) print(i18n("details.address_resolution_protocol")) print[[ | ]] print(i18n("details.arp_requests")) print[[ | ]] print(i18n("details.arp_replies")) print([[ |
| ]]..formatValue(mac_info["arp_requests.sent"])..[[ ]]..i18n("sent")..[[ / ]]..formatValue(mac_info["arp_requests.rcvd"])..[[ ]]..i18n("received")..[[ | ]]..formatValue(mac_info["arp_replies.sent"])..[[ ]]..i18n("sent")..[[ / ]]..formatValue(mac_info["arp_replies.rcvd"])..[[ ]]..i18n("received")..[[ | |