Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
--
-- (C) 2019-24 - ntop.org
-- (C) 2019-25 - ntop.org
--

local alert_consts = require("alert_consts")
local alerts_api = require("alerts_api")
local alert_categories = require "alert_categories"

local script = {
-- Script category
category = alert_categories.internals,
severity = alert_consts.get_printable_severities().warning,
-- Script category
category = alert_categories.internals,
severity = alert_consts.get_printable_severities().warning,

hooks = {},
hooks = {},

gui = {
i18n_title = "alerts_dashboard.redis_reads_writes_exceeded",
i18n_description = "alerts_dashboard.redis_reads_writes_exceeded_descr",
}
gui = {
i18n_title = "alerts_dashboard.redis_reads_writes_exceeded",
i18n_description = "alerts_dashboard.redis_reads_writes_exceeded_descr",
}
}

-- #################################################################
Expand All @@ -40,6 +40,18 @@ local function check_redis_reads_writes_exceeded(params)
schema = 'redis:reads_writes_v2'
}
local ts = ts_utils.timeseries_query(options)
-- Sanity checks
if not ts
or not ts.series
or not ts.series[1]
or not ts.series[2]
or not ts.series[1].statistics
or not ts.series[2].statistics
or ts.series[1].statistics.average == nil
or ts.series[2].statistics.average == nil
then
return
end
-- Check if the day target is nan
if not ts or not (ts.series[1].data[7] == ts.series[1].data[7]) then
return
Expand Down
Loading