diff options
author | Ole Mathias Aa. Heggem <olemathias.aa.heggem@gmail.com> | 2025-04-13 07:18:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-13 07:18:45 +0200 |
commit | 4ea3a099b05fa910498bfbf1b2d7387118355472 (patch) | |
tree | c248cf6764412471ee3e0d1218761bee19fb396a /web/api/read/snmp | |
parent | 09710c061d5b8ae86b3dfe49f4b8936c13a10535 (diff) |
Diffstat (limited to 'web/api/read/snmp')
-rwxr-xr-x | web/api/read/snmp | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/web/api/read/snmp b/web/api/read/snmp deleted file mode 100755 index 0865107..0000000 --- a/web/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 '/opt/gondul/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(); |