mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix some storage mess.
git-svn-id: http://www.observium.org/svn/observer/trunk@943 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -114,3 +114,4 @@ CREATE TABLE IF NOT EXISTS `mempools` ( `mempool_id` int(11) NOT NULL AUTO_INCR
|
||||
ALTER TABLE `storage` CHANGE `storage_id` `storage_id` INT( 11 ) NOT NULL AUTO_INCREMENT , CHANGE `host_id` `device_id` INT( 11 ) NOT NULL , CHANGE `hrStorageIndex` `storage_index` INT( 11 ) NOT NULL , CHANGE `hrStorageType` `storage_type` VARCHAR( 32 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL , CHANGE `hrStorageDescr` `storage_descr` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL , CHANGE `hrStorageSize` `storage_size` INT( 11 ) NOT NULL , CHANGE `hrStorageAllocationUnits` `storage_units` INT( 11 ) NOT NULL , CHANGE `hrStorageUsed` `storage_used` INT( 11 ) NOT NULL , CHANGE `storage_perc` `storage_perc` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL;
|
||||
ALTER TABLE `storage` ADD `storage_mib` VARCHAR( 16 ) NOT NULL AFTER `device_id`;
|
||||
ALTER TABLE `storage` ADD `storage_free` INT NOT NULL AFTER `storage_used`;
|
||||
ALTER TABLE `storage` CHANGE `storage_size` `storage_size` BIGINT NOT NULL ,CHANGE `storage_used` `storage_used` BIGINT NOT NULL ,CHANGE `storage_free` `storage_free` BIGINT NOT NULL
|
||||
|
||||
@@ -21,11 +21,10 @@ if(mysql_result(mysql_query("SELECT count(storage_id) from storage WHERE device_
|
||||
|
||||
if ($skipdrive) { continue; }
|
||||
if(is_integer($drive_rows/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
||||
$total = $drive['storage_size'] * $drive['storage_units'];
|
||||
$used = $drive['storage_used'] * $drive['storage_units'];
|
||||
$perc = round($drive['storage_perc'], 0);
|
||||
$total = formatStorage($total);
|
||||
$used = formatStorage($used);
|
||||
$total = formatStorage($drive['storage_size']);
|
||||
$free = formatStorage($drive['storage_free']);
|
||||
$used = formatStorage($drive['storage_used']);
|
||||
|
||||
$fs_url = "/device/".$device['device_id']."/health/storage/";
|
||||
|
||||
|
||||
@@ -12,13 +12,13 @@ $query = mysql_query($sql);
|
||||
echo("<div style='padding: 5px;'>
|
||||
<table width=100% cellspacing=0 cellpadding=2>");
|
||||
|
||||
#echo("<tr class=tablehead>
|
||||
# <th width=280>Device</th>
|
||||
# <th>Storage</th>
|
||||
# <th width=100></th>
|
||||
# <th width=280>Usage</th>
|
||||
# <th width=100>Used</th>
|
||||
# </tr>");
|
||||
echo("<tr class=tablehead>
|
||||
<th width=280>Device</th>
|
||||
<th>Storage</th>
|
||||
<th width=100></th>
|
||||
<th width=280>Usage</th>
|
||||
<th width=50>Used</th>
|
||||
</tr>");
|
||||
|
||||
$row = 1;
|
||||
|
||||
@@ -37,13 +37,10 @@ while($drive = mysql_fetch_array($query)) {
|
||||
if ($skipdrive) { continue; }
|
||||
if(is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
||||
|
||||
$total = $drive['storage_size'];
|
||||
$used = $drive['storage_used'];
|
||||
$free = $drive['storage_free'];
|
||||
$perc = round($drive['storage_perc'], 0);
|
||||
$free = formatStorage($free);
|
||||
$total = formatStorage($total);
|
||||
$used = formatStorage($used);
|
||||
$total = formatStorage($drive['storage_size']);
|
||||
$free = formatStorage($drive['storage_free']);
|
||||
$used = formatStorage($drive['storage_used']);
|
||||
|
||||
$store_url = "graph.php?id=" . $drive['storage_id'] . "&type=storage&from=$month&to=$now&width=400&height=125";
|
||||
$store_popup = "onmouseover=\"return overlib('<img src=\'$store_url\'>', LEFT);\" onmouseout=\"return nd();\"";
|
||||
|
||||
Reference in New Issue
Block a user