mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 08:02:41 +02:00
continuation of storage changes, addition of rrdtool functions
git-svn-id: http://www.observium.org/svn/observer/trunk@937 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -360,13 +360,13 @@ function unixfsgraph ($id, $graph, $from, $to, $width, $height, $title, $vertica
|
||||
$sql = mysql_query("SELECT * FROM storage where storage_id = '$id'");
|
||||
$options .= "COMMENT:\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Size\ \ \ \ \ \ Used\ \ \ \ %age\l";
|
||||
while($fs = mysql_fetch_array($sql)) {
|
||||
$hostname = gethostbyid($fs['host_id']);
|
||||
$hostname = gethostbyid($fs['device_id']);
|
||||
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"; $iter = "0"; }
|
||||
$descr = str_pad($fs[hrStorageDescr], 14);
|
||||
$descr = str_pad($fs[storage_descr], 14);
|
||||
$descr = substr($descr,0,14);
|
||||
$text = str_replace("/", "_", $fs['hrStorageDescr']);
|
||||
$text = str_replace("/", "_", $fs['storage_descr']);
|
||||
$rrd = $config['rrd_dir'] . "/$hostname/storage-$text.rrd";
|
||||
$options .= " DEF:$fs[storage_id]=$rrd:used:AVERAGE";
|
||||
$options .= " DEF:$fs[storage_id]s=$rrd:size:AVERAGE";
|
||||
@@ -391,16 +391,16 @@ function unixfsgraph_dev ($device, $graph, $from, $to, $width, $height, $title,
|
||||
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
|
||||
$hostname = gethostbyid($device);
|
||||
$iter = "1";
|
||||
$sql = mysql_query("SELECT * FROM storage where host_id = '$device'");
|
||||
$sql = mysql_query("SELECT * FROM storage where device_id = '$device'");
|
||||
$options .= "COMMENT:\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Size\ \ \ \ \ \ Used\ \ \ \ %age\l";
|
||||
while($fs = 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"; $iter = "0"; }
|
||||
|
||||
$descr = str_pad($fs[hrStorageDescr], 14);
|
||||
$descr = str_pad($fs[storage_descr], 14);
|
||||
$descr = substr($descr,0,14);
|
||||
$text = str_replace("/", "_", $fs['hrStorageDescr']);
|
||||
$text = str_replace("/", "_", $fs['storage_descr']);
|
||||
$rrd = $config['rrd_dir'] . "/$hostname/storage-$text.rrd";
|
||||
$options .= " DEF:$fs[storage_id]=$rrd:used:AVERAGE";
|
||||
$options .= " DEF:$fs[storage_id]s=$rrd:size:AVERAGE";
|
||||
|
||||
Reference in New Issue
Block a user