Skip to content

Commit

Permalink
Fix nototal graph option (librenms#13589)
Browse files Browse the repository at this point in the history
  • Loading branch information
nightcore500 authored Dec 1, 2021
1 parent 49587cc commit 12a2627
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion includes/html/graphs/generic_multi_data_separated.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
$rrd_options .= ' CDEF:outB' . $i . '_neg=outB' . $i . ',' . $stacked['stacked'] . ',*';
$rrd_options .= ' CDEF:octets' . $i . '=inB' . $i . ',outB' . $i . ',+';

if (! $args['nototal']) {
if (! $nototal) {
$in_thing .= $seperator . $in . $i . ',UN,0,' . $in . $i . ',IF';
$out_thing .= $seperator . $out . $i . ',UN,0,' . $out . $i . ',IF';
$pluses .= $plus;
Expand Down
16 changes: 8 additions & 8 deletions includes/html/graphs/generic_multi_seperated.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
$rrd_options .= sprintf(" COMMENT:'%12s'", 'Current');
$rrd_options .= sprintf(" COMMENT:'%10s'", 'Average');
$rrd_options .= sprintf(" COMMENT:'%10s'", 'Maximum');
if (! $$args['nototal']) {
if (! $nototal) {
$rrd_options .= sprintf(" COMMENT:'%8s'", 'Total');
}
} else {
Expand All @@ -67,7 +67,7 @@
$rrd_options .= sprintf(" COMMENT:'\t'", '');
$rrd_options .= sprintf(" COMMENT:'%10s'", 'P Avg');
$rrd_options .= sprintf(" COMMENT:'%10s'", 'P Max');
if (! $args['nototal']) {
if (! $nototal) {
$rrd_options .= sprintf(" COMMENT:'%8s'", 'P Total');
}
}
Expand Down Expand Up @@ -110,7 +110,7 @@
$rrd_options .= ' SHIFT:outB' . $i . "X:$period";
}

if (! $args['nototal']) {
if (! $nototal) {
$in_thing .= $seperator . 'inB' . $i . ',UN,0,' . 'inB' . $i . ',IF';
$out_thing .= $seperator . 'outB' . $i . ',UN,0,' . 'outB' . $i . ',IF';
$pluses .= $plus;
Expand Down Expand Up @@ -146,15 +146,15 @@
$rrd_options .= ' GPRINT:inbits' . $i . ':AVERAGE:%6.' . $float_precision . "lf%s$units";
$rrd_options .= ' GPRINT:inbits' . $i . ':MAX:%6.' . $float_precision . "lf%s$units";

if (! $args['nototal']) {
if (! $nototal) {
$rrd_options .= ' GPRINT:totinB' . $i . ':%6.' . $float_precision . "lf%s$total_units";
}

if ($_GET['previous'] == 'yes') {
$rrd_options .= " COMMENT:' \t'";
$rrd_options .= ' GPRINT:inbits' . $i . 'X:AVERAGE:%6.' . $float_precision . "lf%s$units";
$rrd_options .= ' GPRINT:inbits' . $i . 'X:MAX:%6.' . $float_precision . "lf%s$units";
if (! $args['nototal']) {
if (! $nototal) {
$rrd_options .= ' GPRINT:totinB' . $i . 'X' . ':%6.' . $float_precision . "lf%s$total_units";
}
}
Expand All @@ -166,15 +166,15 @@
$rrd_options .= ' GPRINT:outbits' . $i . ':AVERAGE:%6.' . $float_precision . "lf%s$units";
$rrd_options .= ' GPRINT:outbits' . $i . ':MAX:%6.' . $float_precision . "lf%s$units";

if (! $args['nototal']) {
if (! $nototal) {
$rrd_options .= ' GPRINT:totoutB' . $i . ':%6.' . $float_precision . "lf%s$total_units";
}

if ($_GET['previous'] == 'yes') {
$rrd_options .= " COMMENT:' \t'";
$rrd_options .= ' GPRINT:outbits' . $i . 'X:AVERAGE:%6.' . $float_precision . "lf%s$units";
$rrd_options .= ' GPRINT:outbits' . $i . 'X:MAX:%6.' . $float_precision . "lf%s$units";
if (! $args['nototal']) {
if (! $nototal) {
$rrd_options .= ' GPRINT:totoutB' . $i . 'X' . ':%6.' . $float_precision . "lf%s$total_units";
}
}
Expand Down Expand Up @@ -213,7 +213,7 @@
$rrd_optionsb .= ' LINE1.25:dout' . $format . 'X#666666:';
}

if (! $args['nototal']) {
if (! $nototal) {
$rrd_options .= ' CDEF:inB=' . $in_thing . $pluses;
$rrd_options .= ' CDEF:outB=' . $out_thing . $pluses;
$rrd_options .= ' CDEF:octets=inB,outB,+';
Expand Down
2 changes: 1 addition & 1 deletion includes/html/graphs/qfp/packets.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@
$multiplier = '1';
$colours_out = 'oranges';

$args['nototal'] = 1;
$nototal = 1;

include 'includes/html/graphs/generic_multi_seperated.inc.php';
2 changes: 1 addition & 1 deletion includes/html/graphs/qfp/throughput.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@
$multiplier = '1';
$colours_out = 'oranges';

$args['nototal'] = 1;
$nototal = 1;

include 'includes/html/graphs/generic_multi_seperated.inc.php';

0 comments on commit 12a2627

Please sign in to comment.