ntopng/scripts/lua/get_notification_endpoints.lua

23 lines
672 B
Lua

--
-- (C) 2020 - ntop.org
--
local dirs = ntop.getDirs()
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
require "lua_utils"
local plugins_utils = require("plugins_utils")
local notification_endpoints = require("notification_endpoints")
local json = require "dkjson"
sendHTTPContentTypeHeader('application/json')
if (not isAdministrator()) then
traceError(TRACE_ERROR, TRACE_CONSOLE, "The user doesn't have the privileges to get notification endpoint!")
reportError("The user doesn't have the privileges to get notification endpoint!")
end
local endpoints = notification_endpoints.get_configs()
print(json.encode(endpoints))