mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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:
@@ -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,+";
|
||||
|
Reference in New Issue
Block a user