mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 23:49:33 +00:00
Make engaged/past alerts links point to historical flows
This commit is contained in:
parent
6879dc6c7d
commit
f007fbaaee
1 changed files with 11 additions and 5 deletions
|
|
@ -580,28 +580,34 @@ end
|
|||
-- If entity_info is nil, then no links will be provided.
|
||||
--
|
||||
local function formatAlertEntity(ifid, entity_type, entity_value, entity_info)
|
||||
require "flow_utils"
|
||||
local value
|
||||
local epoch_begin, epoch_end = getAlertTimeBounds({alert_tstamp = os.time()})
|
||||
|
||||
if entity_type == "host" then
|
||||
local host_info = hostkey2hostinfo(entity_value)
|
||||
value = resolveAddress(host_info)
|
||||
|
||||
if host_info ~= nil then
|
||||
value = "<a href='"..ntop.getHttpPrefix().."/lua/host_details.lua?ifid="..ifid
|
||||
.."&host="..hostinfo2hostkey(host_info).."'>"..value.."</a>"
|
||||
value = "<a href='"..ntop.getHttpPrefix().."/lua/host_details.lua?ifid="..ifid..
|
||||
"&host="..hostinfo2hostkey(host_info).."&page=historical&epoch_begin="..
|
||||
epoch_begin .."&epoch_end=".. epoch_end .."'>"..value.."</a>"
|
||||
end
|
||||
elseif entity_type == "interface" then
|
||||
value = getInterfaceName(ifid)
|
||||
|
||||
if entity_info ~= nil then
|
||||
value = "<a href='"..ntop.getHttpPrefix().."/lua/if_stats.lua?ifid="..ifid.."'>"..value.."</a>"
|
||||
value = "<a href='"..ntop.getHttpPrefix().."/lua/if_stats.lua?ifid="..ifid..
|
||||
"&page=historical&epoch_begin="..epoch_begin .."&epoch_end=".. epoch_end ..
|
||||
"'>"..value.."</a>"
|
||||
end
|
||||
elseif entity_type == "network" then
|
||||
value = hostkey2hostinfo(entity_value)["host"]
|
||||
|
||||
if entity_info ~= nil then
|
||||
value = "<a href='"..ntop.getHttpPrefix().."/lua/network_details.lua?network="..(entity_info.network_id).."&page=historical'>"
|
||||
..value.."</a>"
|
||||
value = "<a href='"..ntop.getHttpPrefix().."/lua/network_details.lua?network="..
|
||||
(entity_info.network_id).."&page=historical&epoch_begin=".. epoch_begin
|
||||
.."&epoch_end=".. epoch_end .."'>" ..value.."</a>"
|
||||
end
|
||||
else
|
||||
-- fallback
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue