Harmonizes scores for Lua-triggered alerts

Addresses #5315
This commit is contained in:
Simone Mainardi 2021-05-12 12:56:12 +02:00
parent e315669d5d
commit d45ab54934
11 changed files with 18 additions and 12 deletions

View file

@ -113,6 +113,12 @@ function Alert:set_score(score)
self.score = tonumber(score)
end
--@brief Methods to set score defaults, keep them in sync with
-- ntop_defines.h
function Alert:set_score_notice() self.score = 20 --[[ SCORE_LEVEL_NOTICE --]] end
function Alert:set_score_warning() self.score = 50 --[[ SCORE_LEVEL_WARNING --]] end
function Alert:set_score_error() self.score = 100 --[[ SCORE_LEVEL_ERROR --]] end
-- ##############################################
function Alert:set_subtype(subtype)