Unifies host_details.lua generation

Addresses #3977
This commit is contained in:
Simone Mainardi 2020-05-26 12:48:46 +02:00
parent ed0c6e46d2
commit 49e49e0ed6
30 changed files with 217 additions and 187 deletions

View file

@ -7,11 +7,12 @@ local alert_keys = require "alert_keys"
local function remoteToRemoteFormatter(ifid, alert, info)
local alert_consts = require "alert_consts"
return(i18n("alert_messages.host_remote_to_remote", {
url = ntop.getHttpPrefix() .. "/lua/host_details.lua?host=" .. hostinfo2hostkey(hostkey2hostinfo(alert.alert_entity_val)),
flow_alerts_url = ntop.getHttpPrefix() .."/lua/show_alerts.lua?status=historical-flows&alert_type="..alert_consts.alertType("alert_remote_to_remote"),
ip = info.host,
mac = get_mac_url(info.mac),
return(i18n("alert_messages.host_remote_to_remote",
{
url = hostinfo2detailsurl(hostinfo2hostkey(hostkey2hostinfo(alert.alert_entity_val))),
flow_alerts_url = ntop.getHttpPrefix() .."/lua/show_alerts.lua?status=historical-flows&alert_type="..alert_consts.alertType("alert_remote_to_remote"),
ip = info.host,
mac = get_mac_url(info.mac),
}))
end