mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
[VS] Add the commonly used subnets. (#7943)
This commit is contained in:
parent
06af740b92
commit
0aa1cacb71
6 changed files with 88 additions and 24 deletions
|
|
@ -2567,10 +2567,25 @@ function vs_utils.exec_netscan(host, cidr)
|
|||
) then
|
||||
result[#result+1] = host -- return it as is
|
||||
else
|
||||
local net_range = '1-254'
|
||||
if (cidr == 25) then
|
||||
net_range = '1-127'
|
||||
elseif (cidr == 26) then
|
||||
net_range = '1-63'
|
||||
elseif (cidr == 27) then
|
||||
net_range = '1-31'
|
||||
elseif (cidr == 28) then
|
||||
net_range = '1-15'
|
||||
elseif (cidr == 29) then
|
||||
net_range = '1-7'
|
||||
elseif (cidr == 30) then
|
||||
net_range = '1-3'
|
||||
end
|
||||
|
||||
local s = string.split(host, '%.')
|
||||
local net = s[1].."."..s[2].."."..s[3].."."
|
||||
local nmap = vs_utils.get_nmap_path()
|
||||
local command = nmap..' -sP -n ' .. net .. '1-254'
|
||||
local command = nmap..' -sP -n ' .. net .. net_range
|
||||
|
||||
begin_epoch = os.time()
|
||||
out = ntop.execCmd(command)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue