mirror of
https://github.com/librenms/librenms.git
synced 2024-09-21 10:28:13 +00:00
Remove $_GET from graphs (#14554)
Fixes issues setting variables in other contexts
This commit is contained in:
parent
624ebf8d55
commit
95a0050074
@ -97,6 +97,7 @@ class GraphParameters
|
||||
'total' => ! ($vars['nototal'] ?? $this->is_small),
|
||||
'details' => ! ($vars['nodetails'] ?? $this->is_small),
|
||||
'aggregate' => ! empty($vars['noagg']),
|
||||
'previous' => isset($vars['previous']) && $vars['previous'] == 'yes',
|
||||
];
|
||||
|
||||
$this->from = Time::parseAt($vars['from'] ?? '-1d');
|
||||
|
@ -49,10 +49,6 @@ $ds_list[1]['descr'] = ' Total Cost';
|
||||
$ds_list[1]['units_text'] = '$';
|
||||
$ds_list[1]['colour'] = '006600'; // money green
|
||||
|
||||
if ($_GET['debug']) {
|
||||
print_r($ds_list);
|
||||
}
|
||||
|
||||
// COMMON OPTIONS
|
||||
|
||||
//$from = ;
|
||||
|
@ -18,7 +18,7 @@ $colour_line_out = '000099';
|
||||
$colour_area_in = 'CDEB8B';
|
||||
$colour_area_out = 'C3D9FF';
|
||||
|
||||
$hostname = (isset($_GET['hostname']) ? $_GET['hostname'] : 'unknown');
|
||||
$hostname = $vars['hostname'] ?? 'unknown';
|
||||
$rrd_filename = Rrd::name($device['hostname'], ['app', 'shoutcast', $app->app_id, $hostname]);
|
||||
|
||||
require 'includes/html/graphs/generic_data.inc.php';
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
$hostname = (isset($_GET['hostname']) ? $_GET['hostname'] : 'unkown');
|
||||
$hostname = $vars['hostname'] ?? 'unknown';
|
||||
$rrd_filename = Rrd::name($device['hostname'], ['app', 'shoutcast', $app->app_id, $hostname]);
|
||||
|
||||
require 'includes/html/graphs/common.inc.php';
|
||||
|
@ -1,8 +1,6 @@
|
||||
<?php
|
||||
|
||||
if ($_GET['id'] && is_numeric($_GET['id'])) {
|
||||
$atm_vp_id = $_GET['id'];
|
||||
}
|
||||
$atm_vp_id = $vars['id'] ?? 0;
|
||||
|
||||
$vp = dbFetchRow('SELECT * FROM `juniAtmVp` as J, `ports` AS I, `devices` AS D WHERE J.juniAtmVp_id = ? AND I.port_id = J.port_id AND I.device_id = D.device_id', [$atm_vp_id]);
|
||||
|
||||
|
@ -2,13 +2,13 @@
|
||||
|
||||
require 'includes/html/graphs/device/auth.inc.php';
|
||||
|
||||
if ($auth && is_numeric($_GET['mod']) && is_numeric($_GET['chan'])) {
|
||||
$entity = dbFetchRow('SELECT * FROM entPhysical WHERE device_id = ? AND entPhysicalIndex = ?', [$device['device_id'], $_GET['mod']]);
|
||||
if ($auth && is_numeric($vars['mod']) && is_numeric($vars['chan'])) {
|
||||
$entity = dbFetchRow('SELECT * FROM entPhysical WHERE device_id = ? AND entPhysicalIndex = ?', [$device['device_id'], $vars['mod']]);
|
||||
|
||||
$title .= ' :: ' . $entity['entPhysicalName'];
|
||||
$title .= ' :: Fabric ' . $_GET['chan'];
|
||||
$title .= ' :: Fabric ' . $vars['chan'];
|
||||
|
||||
$graph_title = shorthost($device['hostname']) . '::' . $entity['entPhysicalName'] . '::Fabric' . $_GET['chan'];
|
||||
$graph_title = shorthost($device['hostname']) . '::' . $entity['entPhysicalName'] . '::Fabric' . $vars['chan'];
|
||||
|
||||
$rrd_filename = Rrd::name($device['hostname'], ['c6kxbar', $_GET['mod'], $_GET['chan']]);
|
||||
$rrd_filename = Rrd::name($device['hostname'], ['c6kxbar', $vars['mod'], $vars['chan']]);
|
||||
}
|
||||
|
@ -32,10 +32,6 @@ foreach ((array) \LibreNMS\Config::get('nfsen_rrds', []) as $nfsenrrds) {
|
||||
$unit_text = $dsdescr;
|
||||
$scale_min = '0';
|
||||
|
||||
if ($_GET['debug']) {
|
||||
print_r($rrd_list);
|
||||
}
|
||||
|
||||
$nfsen_iter++;
|
||||
}
|
||||
}
|
||||
|
@ -32,10 +32,6 @@ foreach ((array) \LibreNMS\Config::get('nfsen_rrds', []) as $nfsenrrds) {
|
||||
$unit_text = $dsdescr;
|
||||
$scale_min = '0';
|
||||
|
||||
if ($_GET['debug']) {
|
||||
print_r($rrd_list);
|
||||
}
|
||||
|
||||
$nfsen_iter++;
|
||||
}
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ if (Config::get('applied_site_style') == 'dark') {
|
||||
$rrd_options .= ' GPRINT:ping:LAST:%14.2lf GPRINT:ping:MIN:%6.2lf';
|
||||
$rrd_options .= " GPRINT:ping:MAX:%6.2lf 'GPRINT:ping:AVERAGE:%6.2lf\\n'";
|
||||
|
||||
if ($_GET['previous'] == 'yes') {
|
||||
if ($graph_params->visible('previous')) {
|
||||
$rrd_options .= " COMMENT:' \\n'";
|
||||
$rrd_options .= " DEF:pingX=$rrd_filename:ping:AVERAGE:start=$prev_from:end=$from";
|
||||
$rrd_options .= " SHIFT:pingX:$period";
|
||||
|
@ -11,6 +11,7 @@
|
||||
* option) any later version. Please see LICENSE.txt at the top level of
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
use LibreNMS\Config;
|
||||
|
||||
$scale_min = '0';
|
||||
@ -29,7 +30,7 @@ if (Config::get('applied_site_style') == 'dark') {
|
||||
$rrd_options .= ' GPRINT:poller:LAST:%6.2lf GPRINT:poller:MIN:%6.2lf';
|
||||
$rrd_options .= " GPRINT:poller:MAX:%6.2lf 'GPRINT:poller:AVERAGE:%6.2lf\\n'";
|
||||
|
||||
if ($_GET['previous'] == 'yes') {
|
||||
if ($graph_params->visible('previous')) {
|
||||
$rrd_options .= " COMMENT:' \\n'";
|
||||
$rrd_options .= " DEF:pollerX=$rrd_filename:poller:AVERAGE:start=$prev_from:end=$from";
|
||||
$rrd_options .= " SHIFT:pollerX:$period";
|
||||
|
@ -14,10 +14,6 @@ $rrd_list[2]['filename'] = $file;
|
||||
$rrd_list[2]['descr'] = 'Failed';
|
||||
$rrd_list[2]['ds'] = 'failed';
|
||||
|
||||
if ($_GET['debug']) {
|
||||
print_r($rrd_list);
|
||||
}
|
||||
|
||||
$colours = 'mixed';
|
||||
$nototal = 1;
|
||||
$unit_text = 'Sessions';
|
||||
|
@ -22,7 +22,7 @@ $stacked = generate_stacked_graphs();
|
||||
$inverse = $inverse ?? false;
|
||||
$multiplier = $multiplier ?? false;
|
||||
$format = $format ?? '';
|
||||
$previous = $_GET['previous'] ?? 'no';
|
||||
$previous = $graph_params->visible('previous');
|
||||
|
||||
if ($rrd_filename) {
|
||||
$rrd_filename_out = $rrd_filename;
|
||||
|
@ -61,7 +61,7 @@ if (! empty($graph_max)) {
|
||||
$rrd_options .= ' AREA:dout_max#' . $colour_area_out_max . $stacked['transparency'] . ':';
|
||||
}
|
||||
|
||||
if (isset($_GET['previous']) && $_GET['previous'] == 'yes') {
|
||||
if ($graph_params->visible('previous')) {
|
||||
$rrd_options .= ' DEF:' . $out . 'X=' . $rrd_filename . ':' . $ds_out . ':AVERAGE:start=' . $prev_from . ':end=' . $from;
|
||||
$rrd_options .= ' DEF:' . $in . 'X=' . $rrd_filename . ':' . $ds_in . ':AVERAGE:start=' . $prev_from . ':end=' . $from;
|
||||
$rrd_options .= ' DEF:' . $out . '_maxX=' . $rrd_filename . ':' . $ds_out . ':MAX:start=' . $prev_from . ':end=' . $from;
|
||||
@ -133,7 +133,7 @@ if ($percentile) {
|
||||
$rrd_options .= ' LINE1:dpercentile_out#aa0000';
|
||||
}
|
||||
|
||||
if (isset($_GET['previous']) && $_GET['previous'] == 'yes') {
|
||||
if ($graph_params->visible('previous')) {
|
||||
$rrd_options .= ' LINE1.25:in' . $format . "X#666666:'Prev In \\\\n'";
|
||||
$rrd_options .= ' AREA:in' . $format . 'X#99999966' . $stacked['transparency'] . ':';
|
||||
$rrd_options .= ' LINE1.25:dout' . $format . "X#666666:'Prev Out'";
|
||||
|
@ -36,7 +36,7 @@ foreach ($rrd_filenames as $key => $rrd_filename) {
|
||||
$seperator = ',';
|
||||
$plus = ',+';
|
||||
|
||||
if ($_GET['previous']) {
|
||||
if ($graph_params->visible('previous')) {
|
||||
$rrd_options .= ' DEF:' . $in . 'octets' . $i . 'X=' . $rrd_filename . ':' . $ds_in . ':AVERAGE:start=' . $prev_from . ':end=' . $from;
|
||||
$rrd_options .= ' DEF:' . $out . 'octets' . $i . 'X=' . $rrd_filename . ':' . $ds_out . ':AVERAGE:start=' . $prev_from . ':end=' . $from;
|
||||
$rrd_options .= ' SHIFT:' . $in . 'octets' . $i . "X:$period";
|
||||
@ -73,7 +73,7 @@ if ($i) {
|
||||
$rrd_options .= ' CDEF:dpercentile_outnpn=doutbits,doutbits,-,dpercentile_outnp,-1,*,+';
|
||||
$rrd_options .= ' VDEF:dpercentile_out=dpercentile_outnpn,FIRST';
|
||||
|
||||
if ($_GET['previous'] == 'yes') {
|
||||
if ($graph_params->visible('previous')) {
|
||||
$rrd_options .= ' CDEF:' . $in . 'octetsX=' . $in_thingX . $pluses;
|
||||
$rrd_options .= ' CDEF:' . $out . 'octetsX=' . $out_thingX . $pluses;
|
||||
$rrd_options .= ' CDEF:doutoctetsX=outoctetsX,' . $stacked['stacked'] . ',*';
|
||||
@ -112,7 +112,7 @@ if ($i) {
|
||||
$rrd_options .= ' LINE1:percentile_in#aa0000';
|
||||
$rrd_options .= ' LINE1:dpercentile_out#aa0000';
|
||||
|
||||
if ($_GET['previous'] == 'yes') {
|
||||
if ($graph_params->visible('previous')) {
|
||||
$rrd_options .= ' AREA:inbitsX#9999966' . $stacked['transparency'] . ':';
|
||||
$rrd_options .= ' AREA:doutbitsX#99999966' . $stacked['transparency'] . ':';
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ foreach ($rrd_filenames as $key => $rrd_filename) {
|
||||
$seperator = ',';
|
||||
$plus = ',+';
|
||||
|
||||
if ($_GET['previous']) {
|
||||
if ($graph_params->visible('previous')) {
|
||||
$rrd_options .= ' DEF:' . $in . 'octets' . $i . 'X=' . $rrd_filename . ':' . $ds_in . ':AVERAGE:start=' . $prev_from . ':end=' . $from;
|
||||
$rrd_options .= ' DEF:' . $out . 'octets' . $i . 'X=' . $rrd_filename . ':' . $ds_out . ':AVERAGE:start=' . $prev_from . ':end=' . $from;
|
||||
$rrd_options .= ' SHIFT:' . $in . 'octets' . $i . "X:$period";
|
||||
@ -85,7 +85,7 @@ if ($i) {
|
||||
$rrd_options .= ' VDEF:totout=outoctets,TOTAL';
|
||||
$rrd_options .= ' VDEF:tot=octets,TOTAL';
|
||||
|
||||
if ($_GET['previous'] == 'yes') {
|
||||
if ($graph_params->visible('previous')) {
|
||||
$rrd_options .= ' CDEF:' . $in . 'octetsX=' . $in_thingX . $pluses;
|
||||
$rrd_options .= ' CDEF:' . $out . 'octetsX=' . $out_thingX . $pluses;
|
||||
$rrd_options .= ' CDEF:doutoctetsX=outoctetsX,' . $stacked['stacked'] . ',*';
|
||||
@ -123,7 +123,7 @@ if ($i) {
|
||||
$rrd_options .= ' LINE1:percentile_in#aa0000';
|
||||
$rrd_options .= ' LINE1:dpercentile_out#aa0000';
|
||||
|
||||
if ($_GET['previous'] == 'yes') {
|
||||
if ($graph_params->visible('previous')) {
|
||||
$rrd_options .= ' AREA:in' . $format . 'X#99999999' . $stacked['transparency'] . ':';
|
||||
$rrd_options .= ' AREA:dout' . $format . 'X#99999999' . $stacked['transparency'] . ':';
|
||||
$rrd_options .= ' LINE1:in' . $format . 'X#666666:';
|
||||
|
@ -53,7 +53,7 @@ foreach ($rrd_list as $rrd) {
|
||||
$rrd_options .= ' DEF:' . $rrd['ds'] . $i . 'max=' . $rrd['filename'] . ':' . $rrd['ds'] . ':MAX ';
|
||||
}
|
||||
|
||||
if ($_GET['previous']) {
|
||||
if ($graph_params->visible('previous')) {
|
||||
$rrd_options .= ' DEF:' . $i . 'X=' . $rrd['filename'] . ':' . $rrd['ds'] . ':AVERAGE:start=' . $prev_from . ':end=' . $from;
|
||||
$rrd_options .= ' SHIFT:' . $i . "X:$period";
|
||||
$thingX .= $seperatorX . $i . 'X,UN,0,' . $i . 'X,IF';
|
||||
@ -100,7 +100,7 @@ foreach ($rrd_list as $rrd) {
|
||||
$rrd_options .= " COMMENT:'\\n'";
|
||||
}//end foreach
|
||||
|
||||
if ($_GET['previous'] == 'yes') {
|
||||
if ($graph_params->visible('previous')) {
|
||||
if (is_numeric($multiplier)) {
|
||||
$rrd_options .= ' CDEF:X=' . $thingX . $plusesX . ',' . $multiplier . ',*';
|
||||
} elseif (is_numeric($divider)) {
|
||||
|
@ -18,7 +18,7 @@ use LibreNMS\Config;
|
||||
require 'includes/html/graphs/common.inc.php';
|
||||
|
||||
$format = $format ?? '';
|
||||
$previous = $_GET['previous'] ?? 'no';
|
||||
$previous = $graph_params->visible('previous');
|
||||
$transparency = $transparency ?? false;
|
||||
$stack = $stack ?? '';
|
||||
|
||||
|
@ -5,7 +5,7 @@ require 'includes/html/graphs/common.inc.php';
|
||||
$unitlen = $unitlen ?? 0;
|
||||
$descr_len = $descr_len ?? 0;
|
||||
$multiplier = $multiplier ?? false;
|
||||
$previous = $_GET['previous'] ?? 'no';
|
||||
$previous = $graph_params->visible('previous');
|
||||
$stack = $stack ?? '';
|
||||
|
||||
$seperatorX = '';
|
||||
|
@ -36,7 +36,7 @@ if (\LibreNMS\Config::get('old_graphs')) {
|
||||
$rrd_options .= ' VDEF:' . $ds . '_percentile=' . $ds . ',' . $percentile . ',PERCENT';
|
||||
}
|
||||
|
||||
if ($_GET['previous'] == 'yes') {
|
||||
if ($graph_params->visible('previous')) {
|
||||
if ($multiplier) {
|
||||
$rrd_options .= ' DEF:' . $ds . '_oX=' . $rrd_filename . ':' . $ds . ':AVERAGE:start=' . $prev_from . ':end=' . $from;
|
||||
$rrd_options .= ' DEF:' . $ds . '_max_oX=' . $rrd_filename . ':' . $ds . ':MAX:start=' . $prev_from . ':end=' . $from;
|
||||
@ -106,7 +106,7 @@ if (\LibreNMS\Config::get('old_graphs')) {
|
||||
$rrd_options .= ' LINE1:' . $ds . '_percentile#aa0000';
|
||||
}
|
||||
|
||||
if ($_GET['previous'] == 'yes') {
|
||||
if ($graph_params->visible('previous')) {
|
||||
$rrd_options .= ' LINE1.25:' . $ds . "X#666666:'Prev \\\\n'";
|
||||
$rrd_options .= ' AREA:' . $ds . 'X#99999966:';
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ foreach ($rrd_list as $rrd) {
|
||||
$rrd_options .= ' DEF:' . $rrd['ds'] . $i . 'max=' . $rrd['filename'] . ':' . $rrd['ds'] . ':MAX ';
|
||||
}
|
||||
|
||||
if ($_GET['previous']) {
|
||||
if ($graph_params->visible('previous')) {
|
||||
$rrd_options .= ' DEF:' . $i . 'X=' . $rrd['filename'] . ':' . $rrd['ds'] . ':AVERAGE:start=' . $prev_from . ':end=' . $from;
|
||||
$rrd_options .= ' SHIFT:' . $i . "X:$period";
|
||||
$thingX .= $seperatorX . $i . 'X,UN,0,' . $i . 'X,IF';
|
||||
@ -103,7 +103,7 @@ foreach ($rrd_list as $rrd) {
|
||||
$rrd_options .= " COMMENT:'\\n'";
|
||||
}//end foreach
|
||||
|
||||
if ($_GET['previous'] == 'yes') {
|
||||
if ($graph_params->visible('previous')) {
|
||||
if (is_numeric($multiplier)) {
|
||||
$rrd_options .= ' CDEF:X=' . $thingX . $plusesX . ',' . $multiplier . ',*';
|
||||
} elseif (is_numeric($divider)) {
|
||||
|
@ -53,7 +53,7 @@ foreach ($rrd_list as $rrd) {
|
||||
$rrd_options .= ' DEF:' . $rrd['ds'] . $i . 'max=' . $rrd['filename'] . ':' . $rrd['ds'] . ':MAX ';
|
||||
}
|
||||
|
||||
if ($_GET['previous']) {
|
||||
if ($graph_params->visible('previous')) {
|
||||
$rrd_options .= ' DEF:' . $i . 'X=' . $rrd['filename'] . ':' . $rrd['ds'] . ':AVERAGE:start=' . $prev_from . ':end=' . $from;
|
||||
$rrd_options .= ' SHIFT:' . $i . "X:$period";
|
||||
$thingX .= $seperatorX . $i . 'X,UN,0,' . $i . 'X,IF';
|
||||
@ -103,7 +103,7 @@ foreach ($rrd_list as $rrd) {
|
||||
$rrd_options .= " COMMENT:'\\n'";
|
||||
}//end foreach
|
||||
|
||||
if ($_GET['previous'] == 'yes') {
|
||||
if ($graph_params->visible('previous')) {
|
||||
if (is_numeric($multiplier)) {
|
||||
$rrd_options .= ' CDEF:X=' . $thingX . $plusesX . ',' . $multiplier . ',*';
|
||||
} elseif (is_numeric($divider)) {
|
||||
|
@ -50,7 +50,7 @@ foreach ($modules as $module_index => $module) {
|
||||
|
||||
$cdef[] = $module . $index . $suffix;
|
||||
$suffix = ',+';
|
||||
if ($_GET['previous'] == 'yes') {
|
||||
if ($graph_params->visible('previous')) {
|
||||
$rrd_options .= " DEF:{$module}RawX$index=$rrd_filename:poller:AVERAGE:start=$prev_from:end=$from";
|
||||
// change undefined to 0
|
||||
$rrd_options .= " CDEF:{$module}X$index={$module}RawX$index,UN,0,{$module}RawX$index,IF";
|
||||
@ -67,7 +67,7 @@ foreach ($modules as $module_index => $module) {
|
||||
} else {
|
||||
// have data for this module, display it
|
||||
$rrd_options .= " CDEF:$module=" . implode(',', $cdef);
|
||||
if ($_GET['previous']) {
|
||||
if ($graph_params->visible('previous')) {
|
||||
$rrd_options .= " CDEF:{$module}X=" . implode(',', $cdefX);
|
||||
}
|
||||
}
|
||||
@ -75,7 +75,7 @@ foreach ($modules as $module_index => $module) {
|
||||
|
||||
$rrd_options .= " 'COMMENT:Seconds Cur Min Max Avg'";
|
||||
|
||||
if ($_GET['previous']) {
|
||||
if ($graph_params->visible('previous')) {
|
||||
$rrd_options .= " COMMENT:' \t P Min P Max P Avg'";
|
||||
}
|
||||
|
||||
@ -86,7 +86,7 @@ foreach ($modules as $index => $module) {
|
||||
$rrd_options .= " AREA:$module#$color:'" . \LibreNMS\Data\Store\Rrd::fixedSafeDescr($module, 16) . "':STACK";
|
||||
$rrd_options .= " GPRINT:$module:LAST:%6.2lf GPRINT:$module:MIN:%6.2lf";
|
||||
$rrd_options .= " GPRINT:$module:MAX:%6.2lf 'GPRINT:$module:AVERAGE:%6.2lf'";
|
||||
if ($_GET['previous']) {
|
||||
if ($graph_params->visible('previous')) {
|
||||
$rrd_options .= ' AREA:' . $module . 'X#99999999' . $stacked['transparency'] . ':';
|
||||
$rrd_options .= ' LINE1.25:' . $module . 'X#666666:';
|
||||
$rrd_options .= " COMMENT:'\t'";
|
||||
|
@ -42,7 +42,7 @@ foreach (Device::pluck('hostname') as $index => $hostname) {
|
||||
$rrd_options .= " CDEF:poller$index=pollerRaw$index,UN,0,pollerRaw$index,IF";
|
||||
$cdef[] = 'poller' . $index . $suffix;
|
||||
$suffix = ',+';
|
||||
if ($_GET['previous'] == 'yes') {
|
||||
if ($graph_params->visible('previous')) {
|
||||
$rrd_options .= " DEF:pollerRawX$index=$rrd_filename:poller:AVERAGE:start=$prev_from:end=$from";
|
||||
// change undefined to 0
|
||||
$rrd_options .= " CDEF:pollerX$index=pollerRawX$index,UN,0,pollerRawX$index,IF";
|
||||
@ -60,7 +60,7 @@ $rrd_options .= ' LINE1.25:poller#36393D:Poller';
|
||||
$rrd_options .= ' GPRINT:poller:LAST:%6.2lf GPRINT:poller:MIN:%6.2lf';
|
||||
$rrd_options .= ' GPRINT:poller:MAX:%6.2lf GPRINT:poller:AVERAGE:%6.2lf';
|
||||
$rrd_options .= " 'GPRINT:avgpol:AVERAGE:%6.2lf\\n'";
|
||||
if ($_GET['previous'] == 'yes') {
|
||||
if ($graph_params->visible('previous')) {
|
||||
$rrd_options .= " COMMENT:' \\n'";
|
||||
$rrd_options .= ' CDEF:pollerX=' . implode(',', $cdefX);
|
||||
$rrd_options .= ' CDEF:avgpolX=pollerX,' . count($cdefX) . ',/';
|
||||
|
@ -1,8 +1,6 @@
|
||||
<?php
|
||||
|
||||
if ($_GET['legend']) {
|
||||
$legend = $_GET['legend'];
|
||||
}
|
||||
$legend = $graph_params->visible('legend');
|
||||
|
||||
$rrd_options = "--alt-autoscale-max -E --start $from --end " . ($to - 150) . " --width $width --height $height ";
|
||||
$rrd_options .= \LibreNMS\Config::get('rrdgraph_def_text') . ' -c FONT#' . ltrim(\LibreNMS\Config::get('rrdgraph_def_text_color'), '#');
|
||||
@ -12,7 +10,7 @@ if ($height < '99') {
|
||||
|
||||
$i = 1;
|
||||
|
||||
foreach (explode(',', $_GET['id']) as $ifid) {
|
||||
foreach (explode(',', $vars['id']) as $ifid) {
|
||||
$int = dbFetchRow('SELECT `hostname` FROM `ports` AS I, devices as D WHERE I.port_id = ? AND I.device_id = D.device_id', [$ifid]);
|
||||
$rrd_file = get_port_rrdfile_path($int['hostname'], $ifid);
|
||||
if (Rrd::checkRrdExists($rrd_file)) {
|
||||
@ -30,7 +28,7 @@ foreach (explode(',', $_GET['id']) as $ifid) {
|
||||
unset($seperator);
|
||||
unset($plus);
|
||||
|
||||
foreach (explode(',', $_GET['idb']) as $ifid) {
|
||||
foreach (explode(',', $vars['idb']) as $ifid) {
|
||||
$int = dbFetchRow('SELECT `hostname` FROM `ports` AS I, devices as D WHERE I.port_id = ? AND I.device_id = D.device_id', [$ifid]);
|
||||
$rrd_file = get_port_rrdfile_path($int['hostname'], $ifid);
|
||||
if (Rrd::checkRrdExists($rrd_file)) {
|
||||
|
@ -1,8 +1,6 @@
|
||||
<?php
|
||||
|
||||
if ($_GET['legend']) {
|
||||
$legend = $_GET['legend'];
|
||||
}
|
||||
$legend = $graph_params->visible('legend');
|
||||
|
||||
$rrd_options = " --alt-autoscale-max -E --start $from --end " . ($to - 150) . " --width $width --height $height ";
|
||||
$rrd_options .= \LibreNMS\Config::get('rrdgraph_def_text') . ' -c FONT#' . ltrim(\LibreNMS\Config::get('rrdgraph_def_text_color'), '#');
|
||||
@ -13,7 +11,7 @@ if ($height < '99') {
|
||||
|
||||
$i = 1;
|
||||
|
||||
foreach (explode(',', $_GET['id']) as $ifid) {
|
||||
foreach (explode(',', $vars['id']) as $ifid) {
|
||||
$int = dbFetchRow('SELECT `hostname` FROM `ports` AS I, devices as D WHERE I.port_id = ? AND I.device_id = D.device_id', [$ifid]);
|
||||
$rrd_file = get_port_rrdfile_path($int['hostname'], $ifid);
|
||||
if (Rrd::checkRrdExists($rrd_file)) {
|
||||
@ -39,7 +37,7 @@ foreach (explode(',', $_GET['id']) as $ifid) {
|
||||
unset($seperator);
|
||||
unset($plus);
|
||||
|
||||
foreach (explode(',', $_GET['idb']) as $ifid) {
|
||||
foreach (explode(',', $vars['idb']) as $ifid) {
|
||||
$int = dbFetchRow('SELECT `hostname` FROM `ports` AS I, devices as D WHERE I.port_id = ? AND I.device_id = D.device_id', [$ifid]);
|
||||
$rrd_file = get_port_rrdfile_path($int['hostname'], $ifid);
|
||||
if (Rrd::checkRrdExists($rrd_file)) {
|
||||
@ -65,7 +63,7 @@ foreach (explode(',', $_GET['idb']) as $ifid) {
|
||||
unset($seperator);
|
||||
unset($plus);
|
||||
|
||||
foreach (explode(',', $_GET['idc']) as $ifid) {
|
||||
foreach (explode(',', $vars['idc']) as $ifid) {
|
||||
$int = dbFetchRow('SELECT `hostname` FROM `ports` AS I, devices as D WHERE I.port_id = ? AND I.device_id = D.device_id', [$ifid]);
|
||||
$rrd_file = get_port_rrdfile_path($int['hostname'], $ifid);
|
||||
if (Rrd::checkRrdExists($rrd_file)) {
|
||||
|
@ -9,7 +9,7 @@ $print_total = $print_total ?? false;
|
||||
$percentile = $percentile ?? false;
|
||||
$unit_text = $unit_text ?? '';
|
||||
$line_text = $line_text ?? '';
|
||||
$previous = $_GET['previous'] ?? 'no';
|
||||
$previous = $graph_params->visible('previous');
|
||||
|
||||
$unit_text = str_pad(substr($unit_text, 0, 18), 18);
|
||||
$line_text = str_pad(substr($line_text, 0, 12), 12);
|
||||
|
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
$port = $_GET['id'];
|
||||
$stat = $_GET['stat'] ?: 'bits';
|
||||
$sort = in_array($_GET['sort'], ['in', 'out', 'both']) ? $_GET['sort'] : 'in';
|
||||
$topn = is_numeric($_GET['topn']) ? $_GET['topn'] : '10';
|
||||
$port = $vars['id'];
|
||||
$stat = $vars['stat'] ?: 'bits';
|
||||
$sort = in_array($vars['sort'], ['in', 'out', 'both']) ? $vars['sort'] : 'in';
|
||||
$topn = is_numeric($vars['topn']) ? $vars['topn'] : '10';
|
||||
|
||||
require 'includes/html/graphs/common.inc.php';
|
||||
|
||||
|
@ -17,10 +17,6 @@ $rrd_list[2]['filename'] = $file;
|
||||
$rrd_list[2]['descr'] = 'Failed';
|
||||
$rrd_list[2]['ds'] = 'failed';
|
||||
|
||||
if ($_GET['debug']) {
|
||||
print_r($rrd_list);
|
||||
}
|
||||
|
||||
$colours = 'mixed';
|
||||
$nototal = 1;
|
||||
$unit_text = 'Sessions';
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
use LibreNMS\Config;
|
||||
|
||||
$src = device_by_id_cache($_GET['src']);
|
||||
$src = device_by_id_cache($vars['src']);
|
||||
|
||||
// This is my translation of Smokeping's graphing.
|
||||
// Thanks to Bill Fenner for Perl->Human translation:>
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
use LibreNMS\Config;
|
||||
|
||||
$dest = device_by_id_cache($_GET['dest']);
|
||||
$dest = device_by_id_cache($vars['dest']);
|
||||
|
||||
// This is my translation of Smokeping's graphing.
|
||||
// Thanks to Bill Fenner for Perl->Human translation:>
|
||||
|
@ -5,7 +5,7 @@ $scale_max = '100';
|
||||
|
||||
require 'includes/html/graphs/common.inc.php';
|
||||
|
||||
$previous = $_GET['previous'] ?? 'no';
|
||||
$previous = $graph_params->visible('previous');
|
||||
|
||||
$rrd_options .= ' -b 1024';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user