Fix flow and all alerts from SQLite

This commit is contained in:
Alfredo Cardigliano 2022-04-22 09:28:13 +02:00
parent 17178a1506
commit a20cb09d4d
2 changed files with 15 additions and 5 deletions

View file

@ -26,10 +26,16 @@ local all_alert_store = classes.class(alert_store)
-- ##############################################
function all_alert_store:init(args)
local table_name = "all_alerts"
self.super:init()
-- This is a VIEW, not a table, but still available in SQL
self._table_name = "all_alerts_view"
if ntop.isClickHouseEnabled() then
table_name = "all_alerts_view"
end
-- This is a VIEW, not a real table, but still available in SQL
self._table_name = table_name
self._alert_entity = nil -- No entity
end

View file

@ -28,12 +28,16 @@ local flow_alert_store = classes.class(alert_store)
-- ##############################################
function flow_alert_store:init(args)
local table_name = "flow_alerts"
self.super:init()
-- self._table_name = "flow_alerts"
-- Alerts from historical flows (see also RecipientQueue::enqueue)
self._table_name = "flow_alerts_view"
if ntop.isClickHouseEnabled() then
-- Alerts from historical flows (see also RecipientQueue::enqueue)
table_name = "flow_alerts_view"
end
self._table_name = table_name
self._alert_entity = alert_entities.flow
end