diff options
author | Kristian Lyngstol <kly@kly.no> | 2016-07-01 16:38:36 +0200 |
---|---|---|
committer | Kristian Lyngstol <kly@kly.no> | 2016-07-01 16:38:36 +0200 |
commit | 18be7f053b6a7a8cd19a7340466b68f579eb33cd (patch) | |
tree | 5b340a37751ea9c9da799ba124cd0a9a4f4e8344 /web/api/public/dhcp | |
parent | f3e530f42e350f17f42cf3f8f0f310f433effef9 (diff) |
Implement tags and various other minor tweaks
Diffstat (limited to 'web/api/public/dhcp')
-rwxr-xr-x | web/api/public/dhcp | 5 |
1 files changed, 5 insertions, 0 deletions
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"; |