1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-29 10:59:02 +00:00

Reduce verbosity of clock-skew script

This commit is contained in:
dmiller
2016-10-24 20:17:09 +00:00
parent 949297e5aa
commit 1588974594

View File

@@ -93,12 +93,14 @@ hostaction = function(host)
stddev = math.modf(stddev)
median = math.modf(median)
record_stats(host, mean, stddev, median)
local out = {mean = mean, stddev = stddev, median = median}
return out, ("mean: %s, deviation: %s, median: %s"):format(
stdnse.format_time(mean),
stdnse.format_time(stddev),
stdnse.format_time(median)
)
if mean ~= 0 or stddev ~= 0 or nmap.verbosity() > 1 then
local out = {mean = mean, stddev = stddev, median = median}
return out, ("mean: %s, deviation: %s, median: %s"):format(
stdnse.format_time(mean),
stdnse.format_time(stddev),
stdnse.format_time(median)
)
end
end
local function sorted_keys(t)
@@ -159,7 +161,7 @@ postaction = function()
local out = {}
for mean, group in pairs(groups) do
-- Collapse the biggest group
if #group > host_count // 2 then
if #groups > 1 and #group > host_count // 2 then
out[stdnse.format_time(mean)] = "Majority of systems scanned"
elseif #group > 1 then
-- Only record groups of more than one system together