mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
[VS] Fix find single host function.
This commit is contained in:
parent
0584f6970f
commit
0c403fd7b1
1 changed files with 16 additions and 4 deletions
|
|
@ -1247,13 +1247,25 @@ end
|
|||
-- Function to retrieve a specific host scan info
|
||||
function vs_utils.retrieve_host(host)
|
||||
local hosts_scanned = ntop.getHashKeysCache(host_to_scan_key) or {}
|
||||
|
||||
for key, _ in pairs(hosts_scanned) do
|
||||
if key:find(host) then
|
||||
return json.decode(ntop.getHashCache(host_to_scan_key, key) or "")
|
||||
if key:find(host) and key:find("cve") then
|
||||
local hash_value_string = ntop.getHashCache(host_to_scan_key, key)
|
||||
local hash_prefs_string = ntop.getHashCache(prefs_host_values_key,key)
|
||||
local hash_value = json.decode(hash_prefs_string)
|
||||
if (not isEmptyString(hash_value_string)) then
|
||||
-- hash value found
|
||||
hash_value = json.decode(hash_value_string)
|
||||
local hash_pref_value = json.decode(hash_prefs_string) or {}
|
||||
for k,value in pairs(hash_pref_value) do
|
||||
if (k ~= 'is_ok_last_scan') then
|
||||
hash_value[k] = value
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
return hash_value
|
||||
end
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue