Skip to content

Commit

Permalink
renamed conf variable to 'rrdtool_slope_mode', put code to handle slo…
Browse files Browse the repository at this point in the history
…pe-mode and default value into graph.php
  • Loading branch information
pjjw committed Apr 8, 2011
1 parent f14334a commit 6f9cd08
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion ganglia-web/conf_default.php.in
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ $conf['dwoo_compiled_dir'] = "${conf['gmetad_root']}/dwoo";
$conf['rrdtool'] = "/usr/bin/rrdtool"; $conf['rrdtool'] = "/usr/bin/rrdtool";


# Render graphs with rrdtool's --slope-mode option # Render graphs with rrdtool's --slope-mode option
$conf['slope_mode'] = false; $conf['rrdtool_slope_mode'] = false;


# If rrdcached is being used, this argument must specify the # If rrdcached is being used, this argument must specify the
# socket to use. # socket to use.
Expand Down
9 changes: 0 additions & 9 deletions ganglia-web/eval_conf.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -37,13 +37,4 @@
$rrd_options .= " --daemon ${conf['rrdcached_socket']}"; $rrd_options .= " --daemon ${conf['rrdcached_socket']}";
} }
} }

if( isset( $conf['slope_mode'] ) )
{
if($conf['slope_mode'] )
{
$rrd_options .= " --slope-mode";
}
}

?> ?>
8 changes: 8 additions & 0 deletions ganglia-web/graph.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -287,6 +287,14 @@
# legend: it is displayed above on larger cluster summary graphs. # legend: it is displayed above on larger cluster summary graphs.
if ($size == "small" and ! isset($subtitle)) if ($size == "small" and ! isset($subtitle))
$rrdtool_graph['extras'] = "-g"; $rrdtool_graph['extras'] = "-g";

# munge true/false for slope-mode into present/not-present, respecting rrdtool_slope_mode default
if (isset($rrdtool_graph['slope-mode'])) {
if ($rrdtool_graph['slope-mode'] == True) {
$rrdtool_graph['slope-mode'] = '';
} else unset($rrdtool_graph['slope-mode']);
} else if (isset($conf['rrdtool_slope_mode']) && $conf['rrdtool_slope_mode'] == True)
$rrdtool_graph['slope-mode'] = '';


$command = $conf['rrdtool'] . " graph - $rrd_options "; $command = $conf['rrdtool'] . " graph - $rrd_options ";


Expand Down

0 comments on commit 6f9cd08

Please sign in to comment.