Changed id field in devices table to device_id (!!!1!!1!!eleven!1)

git-svn-id: http://www.observium.org/svn/observer/trunk@69 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2007-04-08 14:34:19 +00:00
parent ff04606a2f
commit e52334f578
20 changed files with 151 additions and 367 deletions
+7 -7
View File
@@ -12,18 +12,18 @@ function temp_graph ($device, $graph, $from, $to, $width, $height, $title, $vert
$iter = "1";
$sql = mysql_query("SELECT * FROM temperature where temp_host = '$device'");
$optsa[] = "COMMENT: Cur Max";
while($fs = mysql_fetch_array($sql)) {
while($temperature = mysql_fetch_array($sql)) {
if($iter=="1") {$colour="CC0000";} elseif($iter=="2") {$colour="008C00";} elseif($iter=="3") {$colour="4096EE";
} elseif($iter=="4") {$colour="73880A";} elseif($iter=="5") {$colour="D01F3C";} elseif($iter=="6") {$colour="36393D";
} elseif($iter=="7") {$colour="FF0084"; unset($iter); }
$fs[temp_descr] = str_pad($fs[temp_descr], 28);
$fs[temp_descr] = substr($fs[temp_descr],0,28);
$temperature['temp_descr'] = str_pad($temperature['temp_descr'], 28);
$temperature['temp_descr'] = substr($temperature['temp_descr'],0,28);
$optsa[] = "DEF:temp$fs[temp_id]=rrd/$hostname-temp$fs[temp_id].rrd:temp:AVERAGE";
$optsa[] = "LINE1:temp$fs[temp_id]#" . $colour . ":$fs[temp_descr]";
$optsa[] = "GPRINT:temp$fs[temp_id]:LAST:%3.0lf°C";
$optsa[] = "GPRINT:temp$fs[temp_id]:MAX:%3.0lf°C\l";
$optsa[] = "DEF:temp" . $temperature[temp_id] . "=rrd/" . $hostname . "-temp-" . $temperature['temp_id'] . ".rrd:temp:AVERAGE";
$optsa[] = "LINE1:temp" . $temperature[temp_id] . "#" . $colour . ":" . $temperature[temp_descr];
$optsa[] = "GPRINT:temp" . $temperature[temp_id] . ":LAST:%3.0lf°C";
$optsa[] = "GPRINT:temp" . $temperature[temp_id] . ":MAX:%3.0lf°C\l";
$iter++;
}
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$mono_font",