mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 16:09:32 +00:00
22 lines
519 B
Lua
22 lines
519 B
Lua
--
|
|
-- (C) 2018 - ntop.org
|
|
--
|
|
|
|
require("lua_utils")
|
|
|
|
local nagios = {}
|
|
|
|
function nagios.sendNotification(notif)
|
|
if ntop.isPro() and hasNagiosSupport() then
|
|
local entity_value = notif.entity_value
|
|
local akey = notif.alert_key
|
|
|
|
if notif.action == "engage" then
|
|
return ntop.sendNagiosAlert(entity_value:gsub("@0", ""), akey, notif.message)
|
|
elseif notif.action == "release" then
|
|
return ntop.withdrawNagiosAlert(entity_value:gsub("@0", ""), akey, "Service OK.")
|
|
end
|
|
end
|
|
end
|
|
|
|
return nagios
|