"; echo "

RRDTool Command

"; echo "
";
    echo escapeshellcmd('rrdtool ' . Rrd::buildCommand('graph', Config::get('temp_dir') . '/' . strgen(), $rrd_options));
    echo '
'; try { Rrd::graph($rrd_options); } catch (\LibreNMS\Exceptions\RrdGraphException $e) { echo "

RRDTool Output

"; echo "
";
        echo $e->getMessage();
        echo '
'; } echo ''; return; } if (empty($rrd_options)) { graph_error($width < 200 ? 'Def Error' : 'Graph Definition Error'); return; } // Generating the graph! try { $image_data = Rrd::graph($rrd_options); // output the graph if (\LibreNMS\Util\Debug::isEnabled()) { echo 'graph'; } else { header('Content-type: ' . get_image_type(Config::get('webui.graph_type'))); echo $output === 'base64' ? base64_encode($image_data) : $image_data; } } catch (\LibreNMS\Exceptions\RrdGraphException $e) { if (\LibreNMS\Util\Debug::isEnabled()) { throw $e; } if (isset($rrd_filename) && ! Rrd::checkRrdExists($rrd_filename)) { graph_error($width < 200 ? 'No Data' : 'No Data file ' . basename($rrd_filename)); } else { graph_error($width < 200 ? 'Draw Error' : 'Error Drawing Graph: ' . $e->getMessage()); } }