GRAPH DOES NOT EXIST"; exit; } /* take graph permissions into account here */ if (!is_graph_allowed($_GET['local_graph_id'])) { header('Location: permission_denied.php'); exit; } $graph_title = get_graph_title($_GET['local_graph_id']); if ($_REQUEST['view_type'] == 'tree') { print ""; }else{ print "
"; } $rras = get_associated_rras($_GET['local_graph_id']); switch ($_REQUEST['action']) { case 'view': api_plugin_hook_function('page_buttons', array('lgid' => $_GET['local_graph_id'], 'leafid' => '',//$leaf_id, 'mode' => 'mrtg', 'rraid' => $_GET['rra_id']) ); ?> 0) { $graph_end = time(); foreach ($rras as $rra) { $graph_start = $graph_end - db_fetch_cell_prepared('SELECT timespan FROM rra WHERE id = ?', array($rra['id'])); ?> 0) { foreach ($rras as $rra) { if ($rra['steps'] * $rra['rows'] * $rra['rrd_step'] > $max_timespan) { $max_timespan = $rra['steps'] * $rra['rows'] * $rra['rrd_step']; } } } /* fetch information for the current RRA */ if (isset($_GET['rra_id']) && $_GET['rra_id'] > 0) { $rra = db_fetch_row_prepared('SELECT id, timespan, steps, name FROM rra WHERE id = ?', array($_GET['rra_id'])); }else{ $rra = db_fetch_row_prepared('SELECT id, timespan, steps, name FROM rra WHERE id = ?', array($rras[0]['id'])); } /* define the time span, which decides which rra to use */ $timespan = -($rra['timespan']); /* find the step and how often this graph is updated with new data */ $ds_step = db_fetch_cell_prepared('SELECT data_template_data.rrd_step FROM (data_template_data, data_template_rrd, graph_templates_item) WHERE graph_templates_item.task_item_id = data_template_rrd.id AND data_template_rrd.local_data_id = data_template_data.local_data_id AND graph_templates_item.local_graph_id = ? LIMIT 0,1', array(get_request_var('local_graph_id'))); $ds_step = empty($ds_step) ? 300 : $ds_step; $seconds_between_graph_updates = ($ds_step * $rra['steps']); $now = time(); if (isset($_GET['graph_end']) && ($_GET['graph_end'] <= $now - $seconds_between_graph_updates)) { $graph_end = $_GET['graph_end']; }else{ $graph_end = $now - $seconds_between_graph_updates; } if (isset($_GET['graph_start'])) { if (($graph_end - $_GET['graph_start'])>$max_timespan) { $graph_start = $now - $max_timespan; }else { $graph_start = $_GET['graph_start']; } }else{ $graph_start = $now + $timespan; } /* required for zoom out function */ if ($graph_start == $graph_end) { $graph_start--; } $graph = db_fetch_row_prepared('SELECT graph_templates_graph.height, graph_templates_graph.width FROM graph_templates_graph WHERE graph_templates_graph.local_graph_id = ?', array(get_request_var('local_graph_id'))); $graph_height = $graph['height']; $graph_width = $graph['width']; if (read_config_option('rrdtool_version') != 'rrd-1.0.x') { if (read_graph_config_option('custom_fonts') == 'on' & read_graph_config_option('title_size') != '') { $title_font_size = read_graph_config_option('title_size'); }elseif (read_config_option('title_size') != '') { $title_font_size = read_config_option('title_size'); $title_font_size = read_config_option('title_size'); }else { $title_font_size = 10; } }else { $title_font_size = 0; } ?> '; print '

'; bottom_footer();
Viewing Graph ''
' src='' border='0' alt=''> Zoom Graph
CSV Export
Graph Source/Properties 'view', 'local_graph_id' => $_GET['local_graph_id'], 'rra' => $rra['id'], 'view_type' => $_REQUEST['view_type'])); ?> images/graph_page_top.gif' border='0' alt='Page Top' title='Page Top' style='padding: 3px;'>
Zooming Graph ''
<?php print htmlspecialchars($graph_title);?> Graph Source/Properties &graph_start=&graph_end='>CSV Export
'zoom', 'local_graph_id' => $_GET['local_graph_id'], 'rra' => $_GET['rra_id'], 'view_type' => $_REQUEST['view_type'])); ?>
Zooming
Viewing Graph Properties ''
' border='0' alt=''> '>Zoom Graph
'>CSV Export
'properties', 'local_graph_id' => $_GET['local_graph_id'], 'rra' => $_GET['rra_id'], 'view_type' => $_REQUEST['view_type'])); ?>