Lowered the maximum amount of alert for jailed host (#8311) and added cleanup at startup

This commit is contained in:
Matteo Biscosi 2024-04-23 10:03:46 -04:00
parent 260510289e
commit d397d47555
2 changed files with 20 additions and 1 deletions

View file

@ -20,7 +20,7 @@ local drop_host_pool_utils = {}
drop_host_pool_utils.ids_ips_jail_add_key = "ntopng.cache.ids_ips_jail_add"
drop_host_pool_utils.ids_ips_jail_remove_key = "ntopng.cache.ids_ips_jail_remove"
drop_host_pool_utils.max_ids_ips_log_queue_len = 1024
drop_host_pool_utils.max_ids_ips_log_queue_len = 256
-- ############################################
@ -144,4 +144,19 @@ end
-- ############################################
function drop_host_pool_utils.clean_list()
if is_ids_ips_log_enabled then
local alert = ntop.lpopCache(drop_host_pool_utils.ids_ips_jail_add_key)
while(alert) do
alert = ntop.lpopCache(drop_host_pool_utils.ids_ips_jail_add_key)
end
alert = ntop.lpopCache(drop_host_pool_utils.ids_ips_jail_remove_key)
while(alert) do
alert = ntop.lpopCache(drop_host_pool_utils.ids_ips_jail_remove_key)
end
end
end
-- ############################################
return drop_host_pool_utils