Skip to content
Browse files

renamed conf variable to 'rrdtool_slope_mode', put code to handle slo…

…pe-mode and default value into graph.php
  • Loading branch information...
1 parent f14334a commit 6f9cd08ebeaa8574593af62d4b865a33c25138ea @pjjw pjjw committed Apr 8, 2011
Showing with 9 additions and 10 deletions.
  1. +1 −1 ganglia-web/conf_default.php.in
  2. +0 −9 ganglia-web/eval_conf.php
  3. +8 −0 ganglia-web/graph.php
View
2 ganglia-web/conf_default.php.in
@@ -37,7 +37,7 @@ $conf['dwoo_compiled_dir'] = "${conf['gmetad_root']}/dwoo";
$conf['rrdtool'] = "/usr/bin/rrdtool";
# 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
# socket to use.
View
9 ganglia-web/eval_conf.php
@@ -37,13 +37,4 @@
$rrd_options .= " --daemon ${conf['rrdcached_socket']}";
}
}
-
-if( isset( $conf['slope_mode'] ) )
-{
- if($conf['slope_mode'] )
- {
- $rrd_options .= " --slope-mode";
- }
-}
-
?>
View
8 ganglia-web/graph.php
@@ -287,6 +287,14 @@
# legend: it is displayed above on larger cluster summary graphs.
if ($size == "small" and ! isset($subtitle))
$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 ";

0 comments on commit 6f9cd08

Please sign in to comment.
Something went wrong with that request. Please try again.