From 18be7f053b6a7a8cd19a7340466b68f579eb33cd Mon Sep 17 00:00:00 2001 From: Kristian Lyngstol Date: Fri, 1 Jul 2016 16:38:36 +0200 Subject: Implement tags and various other minor tweaks --- web/api/public/dhcp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'web/api/public/dhcp') diff --git a/web/api/public/dhcp b/web/api/public/dhcp index ea42b8f..88f1eb5 100755 --- a/web/api/public/dhcp +++ b/web/api/public/dhcp @@ -14,6 +14,11 @@ 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;"); +$q2->execute(); +while (my $ref = $q2->fetchrow_hashref()) { + $nms::web::json{'switches'}{$ref->{sysname}} = $ref; +} $nms::web::cc{'max-age'} = "10"; $nms::web::cc{'stale-while-revalidate'} = "30"; -- cgit v1.2.3