From 6fc1dac1d8a2ca61b7abdb4f6e36360ce14b8655 Mon Sep 17 00:00:00 2001 From: crcro Date: Fri, 8 Jul 2016 17:32:41 +0000 Subject: [PATCH] added the posibility to or not to stack values, made nfs stats graph without stack --- html/includes/graphs/application/nfs-stats.inc.php | 1 + .../graphs/generic_multi_line_exact_numbers.inc.php | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/html/includes/graphs/application/nfs-stats.inc.php b/html/includes/graphs/application/nfs-stats.inc.php index 34482b52e9..02d82cd12c 100644 --- a/html/includes/graphs/application/nfs-stats.inc.php +++ b/html/includes/graphs/application/nfs-stats.inc.php @@ -4,6 +4,7 @@ $scale_min = 0; $colours = 'mixed'; $unit_text = 'Operation'; $unitlen = 9; +$stack = 0; $rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-nfsstats-'.$app['app_id'].'.rrd'; $array = array( 'total' => array( diff --git a/html/includes/graphs/generic_multi_line_exact_numbers.inc.php b/html/includes/graphs/generic_multi_line_exact_numbers.inc.php index c47e330b35..5561286ef4 100644 --- a/html/includes/graphs/generic_multi_line_exact_numbers.inc.php +++ b/html/includes/graphs/generic_multi_line_exact_numbers.inc.php @@ -69,10 +69,6 @@ foreach ($rrd_list as $rrd) { $rrd_options .= ' VDEF:tot'.$rrd['ds'].$i.'='.$rrd['ds'].$i.',TOTAL'; } - if ($i) { - $stack = ':STACK'; - } - $g_defname = $rrd['ds']; if (is_numeric($multiplier)) { $g_defname = $rrd['ds'].'_cdef'; @@ -92,6 +88,10 @@ foreach ($rrd_list as $rrd) { $t_defname = $g_defname; } + if ($i && ($stack === 1)) { + $stack = ':STACK'; + } + $rrd_options .= ' LINE2:'.$g_defname.$i.'#'.$colour.":'".$descr."'$stack"; $rrd_options .= ' GPRINT:'.$t_defname.$i.':LAST:%8.0lf%s GPRINT:'.$t_defname.$i.'min:MIN:%8.0lf%s'; $rrd_options .= ' GPRINT:'.$t_defname.$i.'max:MAX:%8.0lf%s GPRINT:'.$t_defname.$i.":AVERAGE:'%8.0lf%s\\n'";