Add more debug messages

This commit is contained in:
Alfredo Cardigliano 2023-11-13 15:22:59 +01:00
parent 6171f889b6
commit 3442e802cb

View file

@ -46,7 +46,7 @@ local periodic_scan_key = "ntopng.vs.periodic_scan"
local periodic_scan_type_key = "ntopng.vs.periodic_scan_type"
local ondemand_scan_key = "ntopng.vs.scan_all"
local scanned_hosts_count_key = "ntopng.prefs.host_to_scan.count_scanned"
local scanned_hosts_changes_key = "ntopng.alerts.scanned_hosts_changes"
local scanned_hosts_changes_queue_key = "ntopng.alerts.scanned_hosts_changes"
local host_in_scanning_hash_key = "ntopng.vs.hosts.in_scanning"
local host_scan_queue_key = "ntopng.vs.scan_queue"
@ -854,8 +854,8 @@ function vs_utils.save_host_to_scan(scan_type, host, scan_result, last_scan_time
if already_scanned then
if(debug_me) then
tprint("ALREADY PRESENT-> CHECKING DIFF")
if debug_me then
-- traceError(TRACE_NORMAL,TRACE_CONSOLE, "Vulnerability Scan: checking for changes in host")
end
local old_cve_no_score = {}
@ -882,7 +882,12 @@ function vs_utils.save_host_to_scan(scan_type, host, scan_result, last_scan_time
})
if host_info_to_cache then
ntop.rpushCache(scanned_hosts_changes_key, json.encode(host_info_to_cache))
if debug_me then
traceError(TRACE_NORMAL,TRACE_CONSOLE, "Vulnerability Scan detected change: enqueueing event to vulnerability_scan check\n")
end
ntop.rpushCache(scanned_hosts_changes_queue_key, json.encode(host_info_to_cache))
end
end
end
@ -967,7 +972,7 @@ function vs_utils.save_host_to_scan(scan_type, host, scan_result, last_scan_time
local result = 1 -- success
if (debug_me) then
tprint("UPDATING HOST: "..host)
-- traceError(TRACE_NORMAL, TRACE_CONSOLE, "Updating host " .. host)
end
-- edit case
@ -1542,7 +1547,7 @@ function vs_utils.scan_host(scan_type, host, ports, scan_id, use_coroutines)
end
if debug_me then
traceError(TRACE_NORMAL, TRACE_CONSOLE, "End scan Host ".. host .. ", result: " .. result .. "\n")
-- traceError(TRACE_NORMAL, TRACE_CONSOLE, "End scan Host ".. host .. ", result: " .. result .. "\n")
end
if (isAlreadyPresent({host= host, scan_type= scan_type})) then