Better Error logging on disk_total_space failure

This commit is contained in:
Isaac Connor 2016-04-09 09:27:12 -04:00
parent 7645e29913
commit e90024c0d0
1 changed files with 4 additions and 0 deletions

View File

@ -1668,6 +1668,10 @@ function getLoad()
function getDiskPercent()
{
$total = disk_total_space(ZM_DIR_EVENTS);
if ( ! $total ) {
Error("disk_total_space returned false for " . ZM_DIR_EVENTS );
return 0;
}
$space = round(($total - disk_free_space(ZM_DIR_EVENTS)) / $total * 100);
return( $space );
}