'/boot', -> mount point * 'warning' => 100*1024*1024, -> threshold for status warning in bytes (100 MB in this sample) * 'critical' => 30*1024*1024 -> threshold for status critical in bytes (30 MB in this sample) * ), */ $CONFIG = array( array( 'directory' => '/boot', 'warning' => 100*1024*1024, 'critical' => 30*1024*1024 ), array( 'directory' => '/', 'warning' => 2*1024*1024, 'critical' => 1*1024*1024 ) ); $hasError = false; foreach($CONFIG as $dir) { $free = disk_free_space( $dir['directory'] ); if ($free < $dir['warning']) { echo "WARNING - only " . number_format($free, 0, ",", ".") . " bytes free in directory ". $dir['directory'] .'|performance:'. $free; $hasError = true; } elseif ($free < $dir['critical']) { echo "FAILURE - only " . number_format($free, 0, ",", ".") . " bytes free in directory ". $dir['directory'] .'|performance:'. $free; $hasError = true; } } if (!$hasError) { echo "OK - " . number_format($free, 0, ",", ".") . " bytes free in directory ". $dir['directory'] .'|performance:'. $free; } ?>