--
-- (C) 2013-16 - 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 vlan_id = _GET["vlan_id"]
local page = "historical" -- only historical for now _GET["page"]
local rrdfile = "bytes.rrd"
if(_GET["rrd_file"] ~= nil) then
rrdfile=_GET["rrd_file"]
end
interface.select(ifname)
ifId = getInterfaceId(ifname)
sendHTTPHeader('text/html; charset=iso-8859-1')
ntop.dumpFile(dirs.installdir .. "/httpdocs/inc/header.inc")
dofile(dirs.installdir .. "/scripts/lua/inc/menu.lua")
if vlan_id == nil or tonumber(vlan_id) == nil or tonumber(vlan_id) == 0 then
print("
 .. )
Vlan_Id parameter is missing or is not valid
")
return
end
local rrdname = getRRDName(ifId, "vlan:"..vlan_id, rrdfile)
if(not ntop.exists(rrdname) and rrdfile ~= "all") then
print(" .. )
No available stats for VLAN "..vlan_id..". Please wait a few minutes to allow ntopng to harvest new statistics.
")
return
end
--[[
Create Menu Bar with buttons
--]]
local nav_url = ntop.getHttpPrefix().."/lua/vlan_details.lua?vlan_id="..vlan_id
print [[
]]
--[[
Selectively render information pages
--]]
if page == "historical" then
vlan_url = ntop.getHttpPrefix()..'/lua/vlan_details.lua?ifname='..ifId..'&vlan_id='..vlan_id..'&page=historical'
drawRRD(ifId, 'vlan:'..vlan_id, rrdfile, _GET["graph_zoom"], vlan_url, 1, _GET["epoch"], nil, makeTopStatsScriptsArray())
end
dofile(dirs.installdir .. "/scripts/lua/inc/footer.lua")