aboutsummaryrefslogtreecommitdiffstats
path: root/web/nms.gathering.org/api/public
diff options
context:
space:
mode:
authorKristian Lyngstol <kly@kly@.no>2016-03-22 15:06:50 +0100
committerKristian Lyngstol <kly@kly@.no>2016-03-22 15:06:50 +0100
commit89c78bc9eab3b69fe31babe5e64f0343386f67be (patch)
tree2a1604fb621c86aca6846f0a8a1704e90cbb0593 /web/nms.gathering.org/api/public
parent7507d6f1dae6261ecb5ad59d556c264fd8e54e04 (diff)
NMS: DHCP map
Diffstat (limited to 'web/nms.gathering.org/api/public')
-rwxr-xr-xweb/nms.gathering.org/api/public/dhcp1
-rwxr-xr-xweb/nms.gathering.org/api/public/switch-state2
2 files changed, 2 insertions, 1 deletions
diff --git a/web/nms.gathering.org/api/public/dhcp b/web/nms.gathering.org/api/public/dhcp
index d432af0..91d52af 100755
--- a/web/nms.gathering.org/api/public/dhcp
+++ b/web/nms.gathering.org/api/public/dhcp
@@ -7,6 +7,7 @@ use strict;
use warnings;
use Data::Dumper;
+nms::web::setwhen('60m');
my $q = $nms::web::dbh->prepare('select distinct on (sysname) extract(epoch from date_trunc(\'second\',time)) as time,sysname from dhcp join switches on dhcp.switch = switches.switch where ' . $nms::web::when . ' order by sysname,time desc;');
$q->execute();
while ( my $ref = $q->fetchrow_hashref() ) {
diff --git a/web/nms.gathering.org/api/public/switch-state b/web/nms.gathering.org/api/public/switch-state
index 6f7573c..4907449 100755
--- a/web/nms.gathering.org/api/public/switch-state
+++ b/web/nms.gathering.org/api/public/switch-state
@@ -20,7 +20,7 @@ while ( my $ref = $q->fetchrow_hashref() ) {
my %port = %{$data{'ports'}{$porti}};
my $smallport = $porti;
$smallport =~ s/[0-9-].*$//;
- if ($porti =~ /ge-0\/0\/4[4-7]/) {
+ if ($porti =~ /ge-0\/0\/4[4-7]$/) {
$json{'switches'}{$sysname}{'uplinks'}{'ifHCInOctets'} += $port{'ifHCInOctets'};
$json{'switches'}{$sysname}{'uplinks'}{'ifHCOutOctets'} += $port{'ifHCOutOctets'};
if ($port{'ifOperStatus'} eq "up") {