$sMessage='['.$sDirectory.'] has '.$this->_getHrSize($iSpaceLeft).' left.';
if($iWarn){
if($iWarn<=$iCritical){
header('HTTP/1.0 503 Service Unavailable');
die("ERROR in a Diskfree check - warning value must be larger than critical.<pre>".print_r($aParams,true));
}
if($iWarn<$iSpaceLeft){
$this->_setReturn(RESULT_OK,$sMessage.' Warning level is not reached yet (still '.$this->_getHrSize($iSpaceLeft-$iWarn).' over warning limit).');
returntrue;
}
if($iWarn>$iSpaceLeft&&$iCritical<$iSpaceLeft){
$this->_setReturn(RESULT_WARNING,$sMessage.' Warning level '.$this->_getHrSize($iWarn).' was reached (space is '.$this->_getHrSize($iWarn-$iSpaceLeft).' below warning limit; still '.$this->_getHrSize($iSpaceLeft-$iCritical).' over critical limit).');
returntrue;
}
}
// check space
if($iCritical<$iSpaceLeft){
$this->_setReturn(RESULT_OK,$sMessage.' Minimum is not reached yet (still '.$this->_getHrSize($iSpaceLeft-$iCritical).' over critical limit).');
}else{
$this->_setReturn(RESULT_ERROR,$sMessage);
}
returntrue;
}
/**
* check a file
* @param array $aParams
* array(
* "filename" directory that must exist
* "writable" flag to check that it must be writable too