mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 23:49:33 +00:00
32 lines
687 B
Lua
32 lines
687 B
Lua
--
|
|
-- (C) 2017-18 - ntop.org
|
|
--
|
|
|
|
dirs = ntop.getDirs()
|
|
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
|
|
|
require "lua_utils"
|
|
local recording_utils = require "recording_utils"
|
|
local json = require("dkjson")
|
|
|
|
sendHTTPHeader('application/json')
|
|
|
|
if not recording_utils.isAvailable() then
|
|
return
|
|
end
|
|
|
|
local epoch_begin = tonumber(_GET["epoch_begin"])
|
|
local epoch_end = tonumber(_GET["epoch_end"])
|
|
|
|
interface.select(ifname)
|
|
|
|
local ifstats = interface.getStats()
|
|
|
|
local result = {}
|
|
if recording_utils.isDataAvailable(ifstats.id, epoch_begin, epoch_end) then
|
|
result["available"] = "true"
|
|
else
|
|
result["available"] = "false"
|
|
end
|
|
|
|
print(json.encode(result))
|