aboutsummaryrefslogtreecommitdiffstats
path: root/web/nms.gathering.org/api/read/snmp
diff options
context:
space:
mode:
authorOle Mathias Heggem <olemathias.aa.heggem@gmail.com>2023-01-21 19:07:38 +0100
committerOle Mathias Heggem <olemathias.aa.heggem@gmail.com>2023-01-21 19:07:38 +0100
commit709c78569b26677624e60588fa1166dc659ac93c (patch)
tree2bd5555af31b637d03693b8563fb24b41bf1f22b /web/nms.gathering.org/api/read/snmp
parentf5da0d943401e527f5162e9c6344deb65b19b045 (diff)
chore: cleanup repo
Diffstat (limited to 'web/nms.gathering.org/api/read/snmp')
-rwxr-xr-xweb/nms.gathering.org/api/read/snmp30
1 files changed, 0 insertions, 30 deletions
diff --git a/web/nms.gathering.org/api/read/snmp b/web/nms.gathering.org/api/read/snmp
deleted file mode 100755
index f69ca62..0000000
--- a/web/nms.gathering.org/api/read/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();