Added service map reporting

This commit is contained in:
Luca Deri 2020-10-02 23:28:59 +02:00
parent 1e2846f9d3
commit 21f3fbd847
11 changed files with 186 additions and 29 deletions

View file

@ -3916,6 +3916,27 @@ end
-- ###########################################
local cache = {}
function buildHostHREF(ip_address)
local stats = cache[ip_address]
if(stats == nil) then
stats = interface.getHostInfo(ip_address)
cache[ip_address] = { stats = stats }
else
stats = stats.stats
end
if(stats == nil) then
return(ip_address)
else
local name = stats.name
if((name == nil) or (name == "")) then name = ip_address end
return('<A HREF="'..ntop.getHttpPrefix()..'/lua/host_details.lua?host='..ip_address..'">'..name..'</A>')
end
end
--
-- IMPORTANT