aboutsummaryrefslogtreecommitdiffstats
path: root/web/nms.gathering.org/api/public
diff options
context:
space:
mode:
authorNicolai Tellefsen <niccofyren@gmail.com>2016-03-22 16:08:48 +0100
committerNicolai Tellefsen <niccofyren@gmail.com>2016-03-22 16:08:48 +0100
commita279d087b85ad537172dae627c2793884f1b9f73 (patch)
tree3fed5518e35182e60c62248c6ac77883d4dca15d /web/nms.gathering.org/api/public
parent110b939413ebc7a1b4ef1dc5a5988477d9c594bd (diff)
parent72fb92979ca3dbbbeb55159ce3a9404b8ba49099 (diff)
Merge branch 'master' of https://github.com/tech-server/tgmanage
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
-rwxr-xr-xweb/nms.gathering.org/api/public/switches2
3 files changed, 3 insertions, 2 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") {
diff --git a/web/nms.gathering.org/api/public/switches b/web/nms.gathering.org/api/public/switches
index 7e7f10b..3aa8af8 100755
--- a/web/nms.gathering.org/api/public/switches
+++ b/web/nms.gathering.org/api/public/switches
@@ -12,7 +12,7 @@ use Data::Dumper;
$nms::web::cc{'max-age'} = "60";
-my $q2 = $nms::web::dbh->prepare('select switch,sysname,placement,ip,poll_frequency,community,last_updated from switches where placement is not null');
+my $q2 = $nms::web::dbh->prepare('select switch,sysname,placement,mgmt_v4_addr,mgmt_v6_addr,mgmt_v4_gw,mgmt_v4_netsize,mgmt_v6_gw,mgmt_v6_netsize,mgmt_vlan,traffic_vlan,last_config_fetch,current_mac,poll_frequency,community,last_updated,switchtype from switches where placement is not null');
$q2->execute();
while (my $ref = $q2->fetchrow_hashref()) {