diff --git a/html/includes/graphs/fanspeed.inc.php b/html/includes/graphs/fanspeed.inc.php index c3edbda43..31c073a57 100644 --- a/html/includes/graphs/fanspeed.inc.php +++ b/html/includes/graphs/fanspeed.inc.php @@ -10,17 +10,13 @@ include("common.inc.php"); $hostname = mysql_result(mysql_query("SELECT hostname FROM devices WHERE device_id = '" . $fanspeed['fan_host'] . "'"),0); - $fanspeed['fan_descr_fixed'] = str_pad($fanspeed['fan_descr'], 28); - $fanspeed['fan_descr_fixed'] = substr($fanspeed['fan_descr_fixed'],0,28); + $fanspeed['fan_descr_fixed'] = substr(str_pad($fanspeed['fan_descr'], 28),0,28); $rrd_filename = $config['rrd_dir'] . "/".$hostname."/" . safename("fan-" . $fanspeed['fan_descr'] . ".rrd"); $rrd_options .= " DEF:fan=$rrd_filename:fan:AVERAGE"; - $rrd_options .= " CDEF:fanwarm=fan,".$fanspeed['fan_limit'].",GT,fan,UNKN,IF"; $rrd_options .= " AREA:fan#FFFF99"; - $rrd_options .= " AREA:fanwarm#FF9999"; $rrd_options .= " LINE1.5:fan#cc0000:'" . str_replace(':','\:',str_replace('\*','*',quotemeta($fanspeed['fan_descr_fixed'])))."'"; # Ugly hack :( - $rrd_options .= " LINE1.5:fanwarm#660000"; $rrd_options .= " GPRINT:fan:LAST:%3.0lfrpm"; $rrd_options .= " GPRINT:fan:MAX:%3.0lfrpm\\\\l"; diff --git a/html/includes/graphs/temperature.inc.php b/html/includes/graphs/temperature.inc.php index 079a90de5..5dd4397b6 100644 --- a/html/includes/graphs/temperature.inc.php +++ b/html/includes/graphs/temperature.inc.php @@ -11,8 +11,7 @@ include("common.inc.php"); $hostname = mysql_result(mysql_query("SELECT hostname FROM devices WHERE device_id = '" . $temperature['temp_host'] . "'"),0); - $temperature['temp_descr_fixed'] = str_pad($temperature['temp_descr'], 28); - $temperature['temp_descr_fixed'] = substr($temperature['temp_descr_fixed'],0,28); + $temperature['temp_descr_fixed'] = substr(str_pad($temperature['temp_descr'], 28),0,28); $rrd_filename = $config['rrd_dir'] . "/".$hostname."/" . safename("temp-" . $temperature['temp_descr'] . ".rrd"); diff --git a/html/includes/graphs/voltage.inc.php b/html/includes/graphs/voltage.inc.php index 2b515b1b1..a73092e88 100644 --- a/html/includes/graphs/voltage.inc.php +++ b/html/includes/graphs/voltage.inc.php @@ -10,17 +10,13 @@ include("common.inc.php"); $hostname = mysql_result(mysql_query("SELECT hostname FROM devices WHERE device_id = '" . $voltage['volt_host'] . "'"),0); - $voltage['volt_descr_fixed'] = str_pad($voltage['volt_descr'], 28); - $voltage['volt_descr_fixed'] = substr($voltage['volt_descr_fixed'],0,28); + $voltage['volt_descr_fixed'] = substr(str_pad($voltage['volt_descr'], 28),0,28); $rrd_filename = $config['rrd_dir'] . "/".$hostname."/" . safename("volt-" . $voltage['volt_descr'] . ".rrd"); $rrd_options .= " DEF:volt=$rrd_filename:volt:AVERAGE"; - $rrd_options .= " CDEF:voltwarm=volt,".$voltage['volt_limit'].",GT,volt,UNKN,IF"; $rrd_options .= " AREA:volt#FFFF99"; - $rrd_options .= " AREA:voltwarm#FF9999"; $rrd_options .= " LINE1.5:volt#cc0000:'" . $voltage['volt_descr_fixed']."'"; - $rrd_options .= " LINE1.5:voltwarm#660000"; $rrd_options .= " GPRINT:volt:LAST:%3.0lfV"; $rrd_options .= " GPRINT:volt:MAX:%3.0lfV\\\\l";