Files

43 lines
1.6 KiB
PHP
Raw Permalink Normal View History

2009-05-11 13:58:05 +00:00
<?php
2015-07-13 20:10:26 +02:00
$graph_type = 'storage_usage';
2009-05-11 13:58:05 +00:00
$row = 1;
2015-07-13 20:10:26 +02:00
foreach (dbFetchRows('SELECT * FROM `storage` WHERE device_id = ? ORDER BY storage_descr', array($device['device_id'])) as $drive) {
if (is_integer($row / 2)) {
2019-06-23 00:29:12 -05:00
$row_colour = \LibreNMS\Config::get('list_colour.even');
2016-08-18 20:28:22 -05:00
} else {
2019-06-23 00:29:12 -05:00
$row_colour = \LibreNMS\Config::get('list_colour.odd');
2015-07-13 20:10:26 +02:00
}
2011-03-16 23:10:10 +00:00
2015-07-13 20:10:26 +02:00
$total = $drive['storage_size'];
$used = $drive['storage_used'];
$free = $drive['storage_free'];
$perc = round($drive['storage_perc'], 0);
$used = formatStorage($used);
$total = formatStorage($total);
$free = formatStorage($free);
2015-09-21 01:30:23 +05:30
$storage_descr = $drive['storage_descr'];
2011-03-16 23:10:10 +00:00
2015-07-13 20:10:26 +02:00
$fs_url = 'graphs/id='.$drive['storage_id'].'/type=storage_usage/';
2011-03-16 23:10:10 +00:00
2015-07-13 20:10:26 +02:00
$fs_popup = "onmouseover=\"return overlib('<div class=list-large>".$device['hostname'].' - '.$drive['storage_descr'];
2019-06-23 00:29:12 -05:00
$fs_popup .= "</div><img src=\'graph.php?id=" . $drive['storage_id'] . '&amp;type=' . $graph_type . '&amp;from=' . \LibreNMS\Config::get('time.month') . '&amp;to=' . \LibreNMS\Config::get('time.now') . "&amp;width=400&amp;height=125\'>";
2015-07-13 20:10:26 +02:00
$fs_popup .= "', RIGHT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\"";
2011-03-16 23:10:10 +00:00
2009-05-11 13:58:05 +00:00
2015-07-13 20:10:26 +02:00
$graph_array['id'] = $drive['storage_id'];
$graph_array['type'] = $graph_type;
2009-05-11 13:58:05 +00:00
2015-09-21 01:30:23 +05:30
echo "<div class='panel panel-default'>
<div class='panel-heading'>
<h3 class='panel-title'>$storage_descr <div class='pull-right'>$used/$total - $perc% used</div></h3>
</div>";
echo "<div class='panel-body'>";
2019-04-11 23:26:42 -05:00
include 'includes/html/print-graphrow.inc.php';
2015-09-21 01:30:23 +05:30
echo "</div></div>";
2009-05-11 13:58:05 +00:00
2015-07-13 20:10:26 +02:00
$row++;
}//end foreach