2013-07-12 14:33:17 +02:00
|
|
|
<?php
|
|
|
|
|
2013-08-20 15:32:25 +02:00
|
|
|
namespace Icinga\Module\Monitoring\Object;
|
2013-07-12 14:33:17 +02:00
|
|
|
|
2013-10-15 19:56:33 +02:00
|
|
|
use Icinga\Data\BaseQuery as Query;
|
|
|
|
use Icinga\Module\Monitoring\DataView\HostStatus;
|
2013-07-12 14:33:17 +02:00
|
|
|
|
|
|
|
class Host extends AbstractObject
|
|
|
|
{
|
|
|
|
|
2013-10-15 19:56:33 +02:00
|
|
|
public $type = self::TYPE_HOST;
|
|
|
|
public $prefix = 'host_';
|
2013-10-19 20:09:17 +02:00
|
|
|
private $view = null;
|
2013-07-12 14:33:17 +02:00
|
|
|
|
|
|
|
|
2013-10-15 19:56:33 +02:00
|
|
|
public function populate()
|
2013-07-12 14:33:17 +02:00
|
|
|
{
|
2013-10-15 19:56:33 +02:00
|
|
|
$this->fetchComments()
|
|
|
|
->fetchDowntimes()
|
|
|
|
->fetchHostgroups()
|
2013-07-12 14:33:17 +02:00
|
|
|
->fetchContacts()
|
2013-10-15 19:56:33 +02:00
|
|
|
->fetchContactGroups();
|
2013-07-12 14:33:17 +02:00
|
|
|
}
|
2013-09-04 18:27:16 +02:00
|
|
|
|
2013-10-15 19:56:33 +02:00
|
|
|
protected function getProperties()
|
2013-07-12 14:33:17 +02:00
|
|
|
{
|
2013-10-15 19:56:33 +02:00
|
|
|
$this->view = HostStatus::fromRequest($this->getRequest());
|
|
|
|
return $this->view->getQuery()->fetchRow();
|
2013-07-12 14:33:17 +02:00
|
|
|
}
|
|
|
|
}
|