From b03bb2ac62015d3e7b78e9a5d0f6f7411690363d Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Mon, 8 Aug 2022 08:53:17 +0100 Subject: [PATCH] issue loadmibs if needed when user gets snapshot --- lib/App/Netdisco/Web/AdminTask.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/App/Netdisco/Web/AdminTask.pm b/lib/App/Netdisco/Web/AdminTask.pm index 9bacf9d9..0df76cc1 100644 --- a/lib/App/Netdisco/Web/AdminTask.pm +++ b/lib/App/Netdisco/Web/AdminTask.pm @@ -78,6 +78,9 @@ ajax "/ajax/control/admin/snapshot_req" => require_role admin => sub { send_error('Bad device', 400) if ! $device or $device->addr eq '0.0.0.0'; + add_job('loadmibs') + if not schema('netdisco')->resultset('SNMPObject')->count(); + # will store for download and for browsing add_job('snapshot', $device->addr, 'yes') or send_error('Bad device', 400); };