mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 16:09:32 +00:00
Return rest failure when check is not enabled (#7170)
This commit is contained in:
parent
e7a6059abb
commit
c47858004d
3 changed files with 32 additions and 13 deletions
|
|
@ -10,6 +10,8 @@ require "lua_utils"
|
|||
local auth = require "auth"
|
||||
local rest_utils = require "rest_utils"
|
||||
local all_alert_store = require "all_alert_store".new()
|
||||
local alert_entities = require "alert_entities"
|
||||
local checks = require "checks"
|
||||
|
||||
--
|
||||
-- Trigger a custom host alert
|
||||
|
|
@ -30,6 +32,11 @@ if not auth.has_capability(auth.capabilities.alerts) then
|
|||
return
|
||||
end
|
||||
|
||||
if not checks.isCheckEnabled("host", "external_host_script") then
|
||||
rest_utils.answer(rest_utils.consts.err.not_enabled)
|
||||
return
|
||||
end
|
||||
|
||||
if isEmptyString(ifid) then
|
||||
rc = rest_utils.consts.err.invalid_interface
|
||||
rest_utils.answer(rc)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue