aboutsummaryrefslogtreecommitdiffstats
path: root/web/api/public/dhcp
diff options
context:
space:
mode:
authorKristian Lyngstøl <kly@kly.no>2018-03-21 10:43:33 +0100
committerGitHub <noreply@github.com>2018-03-21 10:43:33 +0100
commit4eaeb1d7dc6095a2eec1b4711de94f907654547e (patch)
tree5b4b00409761f44227b9294e0c62f059ab68fae9 /web/api/public/dhcp
parent0016b6612e79cc5b115aae11c7f37ec2a27420e1 (diff)
parentdfc74df8f82d7c295319f3e197cb2d37a8ee6ddd (diff)
Merge pull request #167 from olemathias/master
Varnish is now installed in the ansible install + chart colors
Diffstat (limited to 'web/api/public/dhcp')
-rwxr-xr-xweb/api/public/dhcp4
1 files changed, 2 insertions, 2 deletions
diff --git a/web/api/public/dhcp b/web/api/public/dhcp
index 88f1eb5..0b0bb49 100755
--- a/web/api/public/dhcp
+++ b/web/api/public/dhcp
@@ -8,13 +8,13 @@ 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;');
+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 . ' and switches.deleted = false order by sysname,time desc;');
$q->execute();
while ( my $ref = $q->fetchrow_hashref() ) {
my $sysname = $ref->{'sysname'};
$json{'dhcp'}{$ref->{'sysname'}} = $ref->{'time'};
}
-my $q2 = $nms::web::dbh->prepare("select sysname,count(distinct mac) as clients,count(distinct ip) as addresses,count(mac) as acks from dhcp natural join switches where $nms::web::when group by switches.sysname;");
+my $q2 = $nms::web::dbh->prepare("select sysname,count(distinct mac) as clients,count(distinct ip) as addresses,count(mac) as acks from dhcp natural join switches where $nms::web::when and switches.deleted = false group by switches.sysname;");
$q2->execute();
while (my $ref = $q2->fetchrow_hashref()) {
$nms::web::json{'switches'}{$ref->{sysname}} = $ref;