diff options
author | Knut Auvor Grythe <knut@auvor.no> | 2015-04-02 08:54:36 +0200 |
---|---|---|
committer | root <root@einstein.tg15.gathering.org> | 2015-04-02 08:54:36 +0200 |
commit | 9f03931fce78a2fe2a21852f7228ea093493d60f (patch) | |
tree | 432ee0724559a8c4d696eaec01ea306ab4c5b6b6 /web/nms.gathering.org/nettkart-json.pl | |
parent | d1eeb0c628ec5cbdb9649a241a02f97016b83015 (diff) |
Update all maps to use the poll2 table
Diffstat (limited to 'web/nms.gathering.org/nettkart-json.pl')
-rwxr-xr-x | web/nms.gathering.org/nettkart-json.pl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/web/nms.gathering.org/nettkart-json.pl b/web/nms.gathering.org/nettkart-json.pl index 7ffd05b..36685a4 100755 --- a/web/nms.gathering.org/nettkart-json.pl +++ b/web/nms.gathering.org/nettkart-json.pl @@ -22,7 +22,7 @@ if (defined($secret2)) { my $dbh = nms::db_connect(); my %json = (); -my $q = $dbh->prepare("select * from ( SELECT switch,sysname,sum(bytes_in) AS bytes_in,sum(bytes_out) AS bytes_out from switches natural left join get_current_datarate() where ip <> inet '127.0.0.1' group by switch,sysname) t1 natural join placements order by zorder;"); +my $q = $dbh->prepare("select * from ( SELECT switch,sysname,sum(ifinoctets) AS ifinoctets,sum(ifoutoctets) AS ifoutoctets from switches natural left join get_current_datarate() where ip <> inet '127.0.0.1' group by switch,sysname) t1 natural join placements order by zorder;"); $q->execute(); while (my $ref = $q->fetchrow_hashref()) { @@ -34,9 +34,9 @@ while (my $ref = $q->fetchrow_hashref()) { my $clr; - if (defined($ref->{'bytes_in'})) { + if (defined($ref->{'ifinoctets'})) { my $intensity = 0.0; - my $traffic = 4.0 * ($ref->{'bytes_in'} + $ref->{'bytes_out'}); # average and convert to bits (should be about the same in practice) + my $traffic = 4.0 * ($ref->{'ifinoctets'} + $ref->{'ifoutoctets'}); # average and convert to bits (should be about the same in practice) my $max = 100_000_000_000.0; # 100Gbit my $min = 10_000_000.0; # 10Mbit |