diff options
author | Joachim Tingvold <joachim@tingvold.com> | 2015-04-01 03:50:30 +0200 |
---|---|---|
committer | root <root@einstein.tg15.gathering.org> | 2015-04-01 03:50:30 +0200 |
commit | d284e121df845de3118b720e374bf3bcfd1c9317 (patch) | |
tree | 773ae49e9b9dc1d4ea7ae44eb92a412bc5af4da1 /web/nms.gathering.org/stromkart.pl | |
parent | 41b1eca7a62d450bc0d2357027a6be6acd51a7a6 (diff) |
NMS-changes
Diffstat (limited to 'web/nms.gathering.org/stromkart.pl')
-rwxr-xr-x | web/nms.gathering.org/stromkart.pl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/web/nms.gathering.org/stromkart.pl b/web/nms.gathering.org/stromkart.pl index e4b32e0..df92906 100755 --- a/web/nms.gathering.org/stromkart.pl +++ b/web/nms.gathering.org/stromkart.pl @@ -30,7 +30,8 @@ my $grn = $img->colorResolve(0, 255, 0); my $wht = $img->colorResolve(255, 255, 255); my $gry = $img->colorResolve(127, 127, 127); -my $q = $dbh->prepare('select switch,sysname,(select placement from placements where placements.switch=switches.switch) as placement,count((bytes_in > 0 and bytes_out > 0) or null) as active_ports,(max(last_poll_time) >= current_timestamp - interval \'2 minutes\') as fresh from switches natural left join get_current_datarate() natural join placements where switchtype like \'dlink3100%\' group by switch,sysname'); +#my $q = $dbh->prepare('select switch,sysname,(select placement from placements where placements.switch=switches.switch) as placement,count((bytes_in > 0 and bytes_out > 0) or null) as active_ports,(max(last_poll_time) >= current_timestamp - interval \'2 minutes\') as fresh from switches natural left join get_current_datarate() natural join placements where switchtype like \'dlink3100%\' group by switch,sysname'); +my $q = $dbh->prepare(' select switch,sysname,(select placement from placements where placements.switch = switches.switch) as placement,count((operstatus = 1) or null) as active_ports from switches natural left join get_operstatus() natural join placements where ifdescr like \'ge-0/0/%\' group by switch,sysname'); $q->execute(); while (my $ref = $q->fetchrow_hashref()) { my $ports = $ref->{'active_ports'}; |