diff options
author | Kristian Lyngstol <kristian@bohemians.org> | 2016-03-27 08:27:17 +0200 |
---|---|---|
committer | Kristian Lyngstol <kristian@bohemians.org> | 2016-03-27 08:27:17 +0200 |
commit | 1d2470a411e5eaac7e5a1c5d5b6b81e92c92f4a8 (patch) | |
tree | 54b901757b088d54d33e70f28a6203383b4dc844 /web/nms-public.gathering.org/api/public/dhcp-summary | |
parent | 0a230ac5481b9518abc64181dbbb4509d83c0b89 (diff) | |
parent | 96a9bb4c42f4b53020302fea2a46e734c61c0319 (diff) |
Merge branch 'master' of github.com:tech-server/tgmanage
Diffstat (limited to 'web/nms-public.gathering.org/api/public/dhcp-summary')
-rwxr-xr-x | web/nms-public.gathering.org/api/public/dhcp-summary | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/web/nms-public.gathering.org/api/public/dhcp-summary b/web/nms-public.gathering.org/api/public/dhcp-summary new file mode 100755 index 0000000..a0e5609 --- /dev/null +++ b/web/nms-public.gathering.org/api/public/dhcp-summary @@ -0,0 +1,16 @@ +#! /usr/bin/perl +use lib '../../../../include'; +use strict; +use warnings; +use nms::web; + +nms::web::setwhen('2h'); + +my $q2 = $nms::web::dbh->prepare("select count(distinct mac) as clients,count(distinct ip) as addresses,count(mac) as acks from dhcp where $nms::web::when;"); +$q2->execute(); +while (my $ref = $q2->fetchrow_hashref()) { + $nms::web::json{'dhcp'} = $ref; +} +$nms::web::cc{'max-age'} = "10"; +$nms::web::cc{'stale-while-revalidate'} = "15"; +finalize_output(); |