mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Implement per-alert-type host counters
Such counters will be used in the future to generate alert timeseries. Counters are not currently serialized as internally discussed. Closes #2728
This commit is contained in:
parent
0d1b4c30a9
commit
c715bb36f3
10 changed files with 59 additions and 44 deletions
|
|
@ -96,7 +96,7 @@ end
|
|||
|
||||
-- ##############################################
|
||||
|
||||
-- TODO remove
|
||||
-- TODO change in "store"
|
||||
--! @brief Triggers a new alert or refreshes an existing one (if already engaged)
|
||||
--! @param entity_value the string representing the entity of the alert (e.g. "192.168.1.1")
|
||||
--! @param alert_message the message (string) or json (table) to store
|
||||
|
|
@ -115,6 +115,11 @@ function alerts_api:trigger(entity_value, alert_message, when)
|
|||
self.type_id, self.subtype or "", self.severity_id,
|
||||
self.entity_type_id, entity_value, msg)
|
||||
|
||||
if(self.entity == "host") then
|
||||
-- NOTE: for engaged alerts this operation is performed during trigger in C
|
||||
interface.incTotalHostAlerts(entity_value, self.type_id)
|
||||
end
|
||||
|
||||
if(rv) then
|
||||
local action = "store"
|
||||
local message = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue