Added support to multi_threshold template for every hook

This commit is contained in:
Matteo Biscosi 2023-02-14 11:56:25 +01:00
parent 6d2ee3d599
commit 7e6bdde2bd
3 changed files with 53 additions and 42 deletions

View file

@ -39,12 +39,19 @@ end
-- #######################################################
function multi_threshold_cross:describeConfig(hooks_conf)
local configured_threshold = hooks_conf.all.script_conf
local configured_threshold = {}
for _, configuration in pairs(hooks_conf or {}) do
if (configuration) and (table.len(configuration) > 0) then
configured_threshold = configuration.script_conf
break
end
end
local msg = ''
for field, value in pairs(configured_threshold) do
if(value.threshold ~= nil) then
msg = msg .. i18n(field) .. ": " .. value.threshold .. "%, "
msg = msg .. i18n(field) .. ": " .. value.threshold .. "%, "
end
end