mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-05 10:41:34 +00:00
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
37 lines
804 B
Lua
37 lines
804 B
Lua
--
|
|
-- (C) 2019 - ntop.org
|
|
--
|
|
|
|
local ts_utils = require("ts_utils_core")
|
|
|
|
local script = {
|
|
-- This module is enabled by default
|
|
default_enabled = true,
|
|
|
|
-- No default configuration is provided
|
|
default_value = {},
|
|
|
|
-- See below
|
|
hooks = {},
|
|
}
|
|
|
|
-- ##############################################
|
|
|
|
function script.hooks.min(params)
|
|
if params.ts_enabled then
|
|
local system_host_stats = ntop.systemHostStat()
|
|
|
|
if((system_host_stats.mem_ntopng_resident ~= nil) and
|
|
(system_host_stats.mem_ntopng_virtual ~= nil)) then
|
|
ts_utils.append("process:resident_memory",
|
|
{
|
|
ifid = getSystemInterfaceId(),
|
|
resident_bytes = system_host_stats.mem_ntopng_resident * 1024,
|
|
}, when, verbose)
|
|
end
|
|
end
|
|
end
|
|
|
|
-- ##############################################
|
|
|
|
return script
|