. * * @link https://www.librenms.org * * @copyright 2022 Tony Murray * @author Tony Murray */ namespace App\Logging\Reporting\Middleware; use LibreNMS\Util\Version; use Spatie\FlareClient\Report; class SetGroups implements \Spatie\FlareClient\FlareMiddleware\FlareMiddleware { /** * Middleware to set LibreNMS and Tools grouping data * * @param \Spatie\FlareClient\Report $report * @param callable $next * @return mixed */ public function handle(Report $report, $next) { try { $version = Version::get(); $report->group('LibreNMS', [ 'Git version' => $version->name(), 'App version' => Version::VERSION, ]); $report->group('Tools', [ 'Database' => $version->databaseServer(), 'Net-SNMP' => $version->netSnmp(), 'Python' => $version->python(), 'RRDtool' => $version->rrdtool(), ]); } catch (\Exception $e) { } return $next($report); } }