2013-07-12 08:33:17 -04:00
|
|
|
<?php
|
|
|
|
|
|
2013-08-20 09:32:25 -04:00
|
|
|
namespace Icinga\Module\Monitoring\Object;
|
2013-07-12 08:33:17 -04:00
|
|
|
|
2013-10-15 13:56:33 -04:00
|
|
|
use Icinga\Module\Monitoring\DataView\ServiceStatus;
|
2014-03-04 07:59:26 -05:00
|
|
|
use Icinga\Data\Db\Query;
|
2013-07-12 08:33:17 -04:00
|
|
|
|
|
|
|
|
class Service extends AbstractObject
|
|
|
|
|
{
|
2014-03-09 14:29:23 -04:00
|
|
|
public $type = 'service';
|
|
|
|
|
public $prefix = 'service_';
|
|
|
|
|
private $view = null;
|
2013-07-12 08:33:17 -04:00
|
|
|
|
2014-03-04 07:59:26 -05:00
|
|
|
protected function applyObjectFilter(Query $query)
|
|
|
|
|
{
|
|
|
|
|
return $query->where('service_host_name', $this->host_name)
|
|
|
|
|
->where('service_description', $this->service_description);
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-15 13:56:33 -04:00
|
|
|
public function populate()
|
2013-07-12 08:33:17 -04:00
|
|
|
{
|
2013-10-15 13:56:33 -04:00
|
|
|
$this->fetchComments()
|
|
|
|
|
->fetchServicegroups()
|
2013-07-12 08:33:17 -04:00
|
|
|
->fetchContacts()
|
2014-01-30 10:34:23 -05:00
|
|
|
->fetchContactGroups()
|
2014-03-08 12:28:19 -05:00
|
|
|
->fetchCustomvars()
|
|
|
|
|
->fetchDowntimes();
|
2013-07-12 08:33:17 -04:00
|
|
|
}
|
2013-09-04 12:27:16 -04:00
|
|
|
|
2013-10-15 13:56:33 -04:00
|
|
|
protected function getProperties()
|
2013-07-12 08:33:17 -04:00
|
|
|
{
|
2013-10-15 13:56:33 -04:00
|
|
|
$this->view = ServiceStatus::fromRequest($this->getRequest());
|
|
|
|
|
return $this->view->getQuery()->fetchRow();
|
2013-07-12 08:33:17 -04:00
|
|
|
}
|
|
|
|
|
}
|