diff options
author | Kristian Lyngstol <kristian@bohemians.org> | 2016-04-12 18:01:32 +0200 |
---|---|---|
committer | Kristian Lyngstol <kristian@bohemians.org> | 2016-04-12 18:01:32 +0200 |
commit | 09ea945c3908fd42e90eb64c194d9af11d174206 (patch) | |
tree | 8bcf0f98113ea4a92effa1c39344730c7e6f50b0 /web/api/public/dhcp-summary | |
parent | c3ebdbda43c23ade1e49dfd9f546fba1d15f9941 (diff) |
Actual initial import
Fetched from tgmanage.
Diffstat (limited to 'web/api/public/dhcp-summary')
-rwxr-xr-x | web/api/public/dhcp-summary | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/web/api/public/dhcp-summary b/web/api/public/dhcp-summary new file mode 100755 index 0000000..a0e5609 --- /dev/null +++ b/web/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(); |