icingaweb2/modules/monitoring/library/Monitoring/Object/Host.php

35 lines
789 B
PHP
Raw Normal View History

2013-07-12 14:33:17 +02:00
<?php
namespace Icinga\Module\Monitoring\Object;
2013-07-12 14:33:17 +02:00
use Icinga\Module\Monitoring\DataView\HostStatus;
use Icinga\Data\Db\Query;
2013-07-12 14:33:17 +02:00
class Host extends AbstractObject
{
public $type = 'host';
public $prefix = 'host_';
private $view = null;
2013-07-12 14:33:17 +02:00
protected function applyObjectFilter(Query $query)
{
return $query->where('host_name', $this->host_name);
}
2013-07-12 14:33:17 +02:00
public function populate()
2013-07-12 14:33:17 +02:00
{
$this->fetchComments()
->fetchHostgroups()
2013-07-12 14:33:17 +02:00
->fetchContacts()
->fetchContactGroups()
->fetchCustomvars()
->fetchDowntimes();
2013-07-12 14:33:17 +02:00
}
protected function getProperties()
2013-07-12 14:33:17 +02:00
{
$this->view = HostStatus::fromRequest($this->getRequest());
return $this->view->getQuery()->fetchRow();
2013-07-12 14:33:17 +02:00
}
}