remove some crap from graphs setup. fetch device array inside graph file, not in graph.php. mres() in graph.php. try to switch to generic $_GET['id'] for everything (peers and ports undone?)

git-svn-id: http://www.observium.org/svn/observer/trunk@1084 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2010-05-02 19:47:09 +00:00
parent 4107118289
commit a40a1244bf
31 changed files with 87 additions and 76 deletions

View File

@@ -5,8 +5,10 @@ $scale_max = "100";
include("common.inc.php");
$device = device_by_id_cache($id);
$iter = "1";
$sql = mysql_query("SELECT * FROM storage where device_id = '$device_id'");
$sql = mysql_query("SELECT * FROM storage where device_id = '$id'");
$rrd_options .= " COMMENT:' Size Used %age\\l'";
while($storage = mysql_fetch_array($sql)) {
if($iter=="1") {$colour="CC0000";} elseif($iter=="2") {$colour="008C00";} elseif($iter=="3") {$colour="4096EE";
@@ -14,7 +16,7 @@ include("common.inc.php");
} elseif($iter=="7") {$colour="FF0084"; $iter = "0"; }
$descr = substr(str_pad($storage[storage_descr], 12),0,12);
$descr = str_replace(":","\:",$descr);
$rrd = $config['rrd_dir'] . "/$hostname/" . safename("storage-".$storage['storage_mib']."-".$storage['storage_descr'].".rrd");
$rrd = $config['rrd_dir'] . "/".$device['hostname']."/" . safename("storage-".$storage['storage_mib']."-".$storage['storage_descr'].".rrd");
$rrd_options .= " DEF:$storage[storage_id]used=$rrd:used:AVERAGE";
$rrd_options .= " DEF:$storage[storage_id]free=$rrd:free:AVERAGE";
$rrd_options .= " CDEF:$storage[storage_id]size=$storage[storage_id]used,$storage[storage_id]free,+";