diff options
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"; |