From 75966fff5ef93f39c94bd31c39ff8f9efdc86ed5 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Tue, 24 Mar 2009 16:26:39 +0000 Subject: [PATCH] fixes for temperature graphing git-svn-id: http://www.observium.org/svn/observer/trunk@378 61d68cd4-352d-0410-923a-c4978735b2b8 --- includes/graphing.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/graphing.php b/includes/graphing.php index f163db923..19fe3813f 100644 --- a/includes/graphing.php +++ b/includes/graphing.php @@ -74,14 +74,13 @@ function temp_graph ($temp, $graph, $from, $to, $width, $height, $title, $vertic $temperature['temp_descr_fixed'] = str_pad($temperature['temp_descr'], 28); $temperature['temp_descr_fixed'] = substr($temperature['temp_descr_fixed'],0,28); - + $filename = str_replace(")", "_", str_replace("(", "_", str_replace("/", "_", str_replace(" ", "_",$temperature['temp_descr'])))); - $temprrd = $config['rrd_dir'] . "/$hostname/temp-" . $filename . ".rrd"; $opts[] = "DEF:temp=$temprrd:temp:AVERAGE"; $opts[] = "CDEF:tempwarm=temp,".$temperature[temp_limit].",GT,temp,UNKN,IF"; - $opts[] = "LINE1.5:temp#006600:'" . trim($temperature[temp_descr_fixed]) . "'"; + $opts[] = "LINE1.5:temp#006600:" . quotemeta($temperature[temp_descr_fixed]); $opts[] = "LINE1.5:tempwarm#cc0000"; $opts[] = "GPRINT:temp:LAST:%3.0lf°C"; $opts[] = "GPRINT:temp:MAX:%3.0lf°C\\\l"; @@ -90,6 +89,7 @@ function temp_graph ($temp, $graph, $from, $to, $width, $height, $title, $vertic $opt = str_replace(" ","\ ", $opt); $options .= " $opt"; } +# echo($config['rrdtool'] . " graph $imgfile $options"); $thing = shell_exec($config['rrdtool'] . " graph $imgfile $options"); return $imgfile; }