fixing hosts_matrix.lua to delete empty lines generated by local hosts

This commit is contained in:
Michele Campus 2015-08-08 22:08:37 +02:00
parent f60aed8b40
commit 653a63aa2c
2 changed files with 45 additions and 23 deletions

View file

@ -580,20 +580,46 @@ function clearbit(x, p)
end
function isBroadMulticast(ip)
if(ip == "0.0.0.0") then return(true) end
-- print(ip)
t = string.split(ip, "%.")
-- print(table.concat(t, "\n"))
if(t == nil) then
return(false) -- Might be an IPv6 address
else
if(tonumber(t[1]) >= 224) then return(true) end
end
return(false)
if(ip == "0.0.0.0") then
return true
end
-- print(ip)
t = string.split(ip, "%.")
-- print(table.concat(t, "\n"))
if(t == nil) then
return false -- Might be an IPv6 address
else
if(tonumber(t[1]) >= 224) then
return true
end
end
return false
end
-- exclude_BroadMultIPv6
function exclude_BroadMultIPv6(ip)
-- check NoIP
if(ip == "0.0.0.0") then
return true
end
-- check IPv6
t = string.split(ip, "%.")
if(t == nil) then
return true
else
-- check Multicast / Broadcast
if(tonumber(t[1]) >= 224) then
return true
end
end
return false
end
function addGauge(name, url, maxValue, width, height)
if(url ~= nil) then print('<A HREF="'..url..'">') end