mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-21 21:04:25 +02:00
parent
068bfc0c71
commit
1f36e545d9
@ -7,6 +7,7 @@ use Icinga\Util\Format;
|
|||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use Icinga\Exception\ProgrammingError;
|
use Icinga\Exception\ProgrammingError;
|
||||||
use Icinga\Web\Widget\Chart\InlinePie;
|
use Icinga\Web\Widget\Chart\InlinePie;
|
||||||
|
use Icinga\Module\Monitoring\Object\Service;
|
||||||
use Zend_Controller_Front;
|
use Zend_Controller_Front;
|
||||||
|
|
||||||
class Perfdata
|
class Perfdata
|
||||||
@ -453,4 +454,30 @@ class Perfdata
|
|||||||
);
|
);
|
||||||
return $parts;
|
return $parts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the state indicated by this perfdata
|
||||||
|
*
|
||||||
|
* @see Service
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function getState()
|
||||||
|
{
|
||||||
|
if ($this->value === null) {
|
||||||
|
return Service::STATE_UNKNOWN;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! ($this->criticalThreshold === null
|
||||||
|
|| $this->value < $this->criticalThreshold)) {
|
||||||
|
return Service::STATE_CRITICAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! ($this->warningThreshold === null
|
||||||
|
|| $this->value < $this->warningThreshold)) {
|
||||||
|
return Service::STATE_WARNING;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Service::STATE_OK;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user