diff options
author | Magnus Kirø <magnuskiro@gmail.com> | 2016-03-22 13:03:34 +0100 |
---|---|---|
committer | Magnus Kirø <magnuskiro@gmail.com> | 2016-03-22 13:03:34 +0100 |
commit | 490560f31c20dd8191ee1a0f8f6e90b2820d7c77 (patch) | |
tree | 14fb04b9f66bb67aab421fff20a2b35e213e41ee /web/nms.gathering.org/api/private/snmp | |
parent | 7806081670c8c9807fc8b6628b3d7a6eff841ded (diff) |
API structure change.
Diffstat (limited to 'web/nms.gathering.org/api/private/snmp')
-rwxr-xr-x | web/nms.gathering.org/api/private/snmp | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/web/nms.gathering.org/api/private/snmp b/web/nms.gathering.org/api/private/snmp deleted file mode 100755 index f69ca62..0000000 --- a/web/nms.gathering.org/api/private/snmp +++ /dev/null @@ -1,30 +0,0 @@ -#! /usr/bin/perl -# vim:ts=8:sw=8 - -use CGI qw(fatalsToBrowser); -use DBI; -use lib '../../../../include'; -use nms; -use nms::web; -use strict; -use warnings; -use JSON; -use Data::Dumper; - -$nms::web::cc{'max-age'} = "10"; - -my $q = $nms::web::dbh->prepare('select sysname,data from snmp natural join switches where id in (select max(id) from snmp where ' - . $nms::web::when . 'group by switch);'); - -$q->execute(); -while (my $ref = $q->fetchrow_hashref()) { - my $sysname = $ref->{'sysname'}; - - # This is, strictly speaking, redundant. But by doing this, we can - # re-use the standard methods of finalize_output() and whatnot. - my $data = JSON::XS::decode_json($ref->{'data'}); - - $nms::web::json{'snmp'}{$ref->{'sysname'}} = $data; -} - -finalize_output(); |