[#266] netdisco subnet utiiization report div by zero (V. Puchkov)

This commit is contained in:
Oliver Gorwits
2016-10-01 19:03:47 +01:00
parent 922c4aa808
commit 3d1d206905
2 changed files with 3 additions and 2 deletions

View File

@@ -14,7 +14,7 @@ __PACKAGE__->result_source_instance->view_definition(<<'ENDSQL');
SELECT net as subnet,
power(2, (32 - masklen(net))) as subnet_size,
count(DISTINCT ip) as active,
round(100 * count(DISTINCT ip) / (power(2, (32 - masklen(net))) - 2)) as percent
round(100 * count(DISTINCT ip) / (power(2, (32 - masklen(net))))) as percent
FROM (
SELECT DISTINCT net, ni.ip
FROM subnets s1, node_ip ni