mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 08:02:41 +02:00
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:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user