ntopng/scripts/lua/test_alerts.lua
emanuele-f a3432e00e8 Implement ntopng plugins
Plugins are a convenient way to group together related lua scripts.
Their primary use case is to group user scripts and their alert/status
definition.
The builtin ntopng user scripts and definitions are now
packed into plugins directories. In future, we will support loading of
user created plugins.
Plugins are loaded at startup into some runtime directories and then
used. Other changes provided by this commit include:

- Add sample flow logger plugin
- Initial support for system user scripts
- Rename edge to threshold
- Migrate system probes to user scripts/plugins
- Migrate scripts to more explicit alerts_api.checkThresholdAlert api
2019-12-10 09:25:57 +01:00

38 lines
1 KiB
Lua

--
-- (C) 2013-19 - ntop.org
--
dirs = ntop.getDirs()
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
require "lua_utils"
local ts_utils = require("ts_utils")
local info = ntop.getInfo()
local page_utils = require("page_utils")
local alerts_api = require("alerts_api")
local format_utils = require("format_utils")
sendHTTPContentTypeHeader('text/html')
page_utils.print_header(i18n("about.about_x", { product=info.product }))
active_page = "about"
dofile(dirs.installdir .. "/scripts/lua/inc/menu.lua")
-- checks all the hosts of the current interface (TODO: iterate all interfaces)
interface.checkHostsAlertsMin()
-- checks the current networks alerts
interface.checkNetworksAlertsMin()
-- checks the current interface alerts
interface.checkInterfaceAlertsMin()
-- run the system scripts
ntop.checkSystemScriptsMin()
--require "snmp_utils"
--run_5min_snmp_caching(600)
--dofile(dirs.installdir .. "/pro/scripts/callbacks/system/5min.lua")
--ntop.checkSNMPDeviceAlerts5Min()
dofile(dirs.installdir .. "/scripts/lua/inc/footer.lua")