");
echo("
Drive |
Usage |
Free |
|
");
$row = 1;
while($drive = mysql_fetch_array($query)) {
if(is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
$total = $drive['hrStorageSize'] * $drive['hrStorageAllocationUnits'];
$used = $drive['hrStorageUsed'] * $drive['hrStorageAllocationUnits'];
$free = $total - $drive['hrStorageUsed'] * $drive['hrStorageAllocationUnits'];
$perc = round($drive['storage_perc'], 0);
$used = formatStorage($used);
$total = formatStorage($total);
$free = formatStorage($free);
$fs_url = "?page=device&id=".$device['device_id']."§ion=dev-storage";
$fs_popup = "onmouseover=\"return overlib('".$device['hostname']." - ".$drive['hrStorageDescr'];
$fs_popup .= "
";
$fs_popup .= "', RIGHT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\"";
if($perc > '90') { $left_background='c4323f'; $right_background='C96A73';
} elseif($perc > '75') { $left_background='bf5d5b'; $right_background='d39392';
} elseif($perc > '50') { $left_background='bf875b'; $right_background='d3ae92';
} elseif($perc > '25') { $left_background='5b93bf'; $right_background='92b7d3';
} else { $left_background='9abf5b'; $right_background='bbd392'; }
echo("" . $drive['hrStorageDescr'] . " |
".print_percentage_bar (400, 20, $perc, "$used / $total", "ffffff", $left_background, $perc . "%", "ffffff", $right_background)."
| " . $free . " | |
");
$graph_type = "hrstorage";
// start temperature graphs
$daily_temp = "graph.php?id=" . $drive['storage_id'] . "&type=$graph_type&from=$day&to=$now&width=212&height=100";
$daily_url = "graph.php?id=" . $drive['storage_id'] . "&type=$graph_type&from=$day&to=$now&width=400&height=150";
$weekly_temp = "graph.php?id=" . $drive['storage_id'] . "&type=$graph_type&from=$week&to=$now&width=212&height=100";
$weekly_url = "graph.php?id=" . $drive['storage_id'] . "&type=$graph_type&from=$week&to=$now&width=400&height=150";
$monthly_temp = "graph.php?id=" . $drive['storage_id'] . "&type=$graph_type&from=$month&to=$now&width=212&height=100";
$monthly_url = "graph.php?id=" . $drive['storage_id'] . "&type=$graph_type&from=$month&to=$now&width=400&height=150";
$yearly_temp = "graph.php?id=" . $drive['storage_id'] . "&type=$graph_type&from=$year&to=$now&width=212&height=100";
$yearly_url = "graph.php?id=" . $drive['storage_id'] . "&type=$graph_type&from=$year&to=$now&width=400&height=150";
echo("");
echo("".$device['hostname']." - ".$drive['hrStorageDescr']." ', LEFT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\">
");
echo("".$device['hostname']." - ".$drive['hrStorageDescr']." ', LEFT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\">
");
echo("".$device['hostname']." - ".$drive['hrStorageDescr']." ', LEFT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\">
");
echo("".$device['hostname']." - ".$drive['hrStorageDescr']." ', LEFT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\">
");
echo(" |
");
$row++;
}
echo("");
?>