type; $subtype = $graph_params->subtype; $height = $graph_params->height; $width = $graph_params->width; $from = $graph_params->from; $to = $graph_params->to; $period = $graph_params->period; $prev_from = $graph_params->prev_from; $inverse = $graph_params->inverse; $in = $graph_params->in; $out = $graph_params->out; $float_precision = $graph_params->float_precision; $title = $graph_params->visible('title'); $nototal = ! $graph_params->visible('total'); $nodetails = ! $graph_params->visible('details'); $noagg = ! $graph_params->visible('aggregate'); $rrd_options = ''; $env = []; if (session('preferences.timezone')) { $env['TZ'] = session('preferences.timezone'); } require Config::get('install_dir') . "/includes/html/graphs/$type/auth.inc.php"; if ($auth && is_customoid_graph($type, $subtype)) { $unit = $vars['unit']; include Config::get('install_dir') . '/includes/html/graphs/customoid/customoid.inc.php'; } elseif ($auth && is_file(Config::get('install_dir') . "/includes/html/graphs/$type/$subtype.inc.php")) { include Config::get('install_dir') . "/includes/html/graphs/$type/$subtype.inc.php"; } else { graph_error("$type*$subtype Graph Template Missing", "$type*$subtype"); } if ($auth === null) { // We are unauthenticated :( graph_error('No Authorization', 'No Auth'); return; } // check after auth if (isset($vars['device']) && empty($device['device_id'])) { throw new \LibreNMS\Exceptions\RrdGraphException('Device not found'); } $rrd_options = $graph_params . ' ' . $rrd_options; // command output requested if (! empty($command_only)) { echo "
RRDTool Command
"; echo ""; echo escapeshellcmd('rrdtool ' . Rrd::buildCommand('graph', Config::get('temp_dir') . '/' . strgen(), $rrd_options)); echo ''; try { Rrd::graph($rrd_options, $env); } catch (\LibreNMS\Exceptions\RrdGraphException $e) { echo "
RRDTool Output
"; echo ""; echo $e->getMessage(); echo ''; } echo '