mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00: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);}
|
||||
|
||||
$percent = round($storage['used'] / $storage['size'] * 100);
|
||||
if ($storage['size'])
|
||||
{
|
||||
$percent = round($storage['used'] / $storage['size'] * 100);
|
||||
}
|
||||
else
|
||||
{
|
||||
$percent = 0;
|
||||
}
|
||||
|
||||
echo($percent."% ");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user