Removed half of the monitor plugins (#6224)

This commit is contained in:
Matteo Biscosi 2022-01-21 19:21:39 +01:00
parent 0ea16ccd7d
commit da8609727f
41 changed files with 508 additions and 678 deletions

View file

@ -8,12 +8,17 @@ package.path = dirs.installdir .. "/scripts/lua/modules/pools/?.lua;" .. package
local scripts_triggers = require "scripts_triggers"
local prefs_dump_utils = require "prefs_dump_utils"
local cpu_utils = require("cpu_utils")
local ts_utils = require("ts_utils_core")
local system_host_stats = cpu_utils.systemHostStats()
local ifstats = interface.getStats()
local when = os.time()
-- Check and possibly dump preferences to a file
prefs_dump_utils.check_dump_prefs_to_disk()
local ifstats = interface.getStats()
local when = os.time()
-- #####################################
-- Dump periodic activities duration if the telementry timeseries preference is enabled
if scripts_triggers.isRrdInterfaceCreation() then
@ -22,11 +27,33 @@ if scripts_triggers.isRrdInterfaceCreation() then
ts_dump.update_internals_periodic_activities_stats(when, ifstats, false)
end
if scripts_triggers.isRrdInterfaceCreation() then
local ts_utils = require("ts_utils_core")
-- #####################################
if scripts_triggers.isRrdInterfaceCreation() then
if areAlertsEnabled() then
ts_utils.append("iface:engaged_alerts", {ifid=getSystemInterfaceId(), engaged_alerts=ifstats.num_alerts_engaged}, when)
ts_utils.append("iface:dropped_alerts", {ifid=getSystemInterfaceId(), dropped_alerts=ifstats.num_dropped_alerts}, when)
end
end
-- #####################################
if cpu_utils.processTimeseriesEnabled() then
ts_utils.append("process:num_alerts", {
ifid = getSystemInterfaceId(),
dropped_alerts = system_host_stats.dropped_alerts or 0,
written_alerts = system_host_stats.written_alerts or 0,
alerts_queries = system_host_stats.alerts_queries or 0
}, when, verbose)
-- #####################################
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
-- #####################################