--
-- (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"
local asn = tonumber(_GET["asn"])
local page = _GET["page"]
local application = _GET["application"]
interface.select(ifname)
local as_info = interface.getASInfo(asn) or {}
local ifId = getInterfaceId(ifname)
local asname = as_info["asname"]
local label = (asn or '')..''
if not isEmptyString(asname) then
label = label.." ["..shortenString(asname).."]"
end
sendHTTPContentTypeHeader('text/html')
ntop.dumpFile(dirs.installdir .. "/httpdocs/inc/header.inc")
dofile(dirs.installdir .. "/scripts/lua/inc/menu.lua")
if isEmptyString(asn) then
print("
 .. )
".. i18n("as_details.as_parameter_missing_message") .. "
")
dofile(dirs.installdir .. "/scripts/lua/inc/footer.lua")
return
end
--[[
Create Menu Bar with buttons
--]]
local nav_url = ntop.getHttpPrefix().."/lua/as_details.lua?asn="..tonumber(asn)
print [[
]]
if isEmptyString(page) or page == "historical" then
local rrdname = getRRDName(ifId, 'asn:'..asn, 'bytes.rrd')
if(not ntop.exists(rrdname)) then
print(" .. )
"..i18n("as_details.no_available_data_for_as",{asn = label}))
print(" "..i18n("as_details.as_timeseries_enable_message",{url = ntop.getHttpPrefix().."/lua/admin/prefs.lua?tab=on_disk_ts",icon_flask="
"})..'
')
else
local rrdfile = "bytes.rrd"
if not isEmptyString(_GET["rrd_file"]) then
rrdfile=_GET["rrd_file"]
end
local asn_url = ntop.getHttpPrefix()..'/lua/as_details.lua?ifid='..ifId..'&asn='..asn..'&page=historical'
drawRRD(ifId, 'asn:'..asn, rrdfile, _GET["zoom"], asn_url, 1, _GET["epoch"], nil, makeTopStatsScriptsArray())
end
elseif page == "flows" then
print [[
]]
end
dofile(dirs.installdir .. "/scripts/lua/inc/footer.lua")