aboutsummaryrefslogtreecommitdiffstats
path: root/web/nms.gathering.org/nettkart-json.pl
diff options
context:
space:
mode:
authorKnut Auvor Grythe <knut@auvor.no>2015-04-03 10:42:38 +0200
committerroot <root@einstein.tg15.gathering.org>2015-04-03 10:42:38 +0200
commitce10416c8c398698d0917a66f022016c330a9530 (patch)
treec86d16e9511b70456e246accee5e5dabadb0511d /web/nms.gathering.org/nettkart-json.pl
parentf41889dafec7522293ac186ec4dbf20005a33fdb (diff)
Make maps use new SQL schema
Diffstat (limited to 'web/nms.gathering.org/nettkart-json.pl')
-rwxr-xr-xweb/nms.gathering.org/nettkart-json.pl6
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 36685a4..c218642 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(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;");
+my $q = $dbh->prepare("select * from ( SELECT switch,sysname,sum(ifhcinoctets) AS ifhcinoctets,sum(ifhcoutoctets) AS ifhcoutoctets 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->{'ifinoctets'})) {
+ if (defined($ref->{'ifhcinoctets'})) {
my $intensity = 0.0;
- my $traffic = 4.0 * ($ref->{'ifinoctets'} + $ref->{'ifoutoctets'}); # average and convert to bits (should be about the same in practice)
+ my $traffic = 4.0 * ($ref->{'ifhcinoctets'} + $ref->{'ifhcoutoctets'}); # 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