mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-01 00:24:21 +02:00
Fix division by zero for broken storage, found by Corentin Chary
git-svn-id: http://www.observium.org/svn/observer/trunk@1792 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -39,7 +39,14 @@ while($storage = mysql_fetch_array($storage_data)) {
|
|||||||
|
|
||||||
if($debug) {print_r($storage);}
|
if($debug) {print_r($storage);}
|
||||||
|
|
||||||
$percent = round($storage['used'] / $storage['size'] * 100);
|
if ($storage['size'])
|
||||||
|
{
|
||||||
|
$percent = round($storage['used'] / $storage['size'] * 100);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$percent = 0;
|
||||||
|
}
|
||||||
|
|
||||||
echo($percent."% ");
|
echo($percent."% ");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user