commit
61357da35c
|
@ -382,6 +382,17 @@ class SimpleQuery implements QueryInterface, Queryable, Iterator
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clear the order if any
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function clearOrder()
|
||||||
|
{
|
||||||
|
$this->order = array();
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether an order is set
|
* Whether an order is set
|
||||||
*
|
*
|
||||||
|
@ -389,13 +400,13 @@ class SimpleQuery implements QueryInterface, Queryable, Iterator
|
||||||
*/
|
*/
|
||||||
public function hasOrder()
|
public function hasOrder()
|
||||||
{
|
{
|
||||||
return !empty($this->order);
|
return ! empty($this->order);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the order if any
|
* Get the order
|
||||||
*
|
*
|
||||||
* @return array|null
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getOrder()
|
public function getOrder()
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,13 +13,20 @@ class ContactQuery extends IdoQuery
|
||||||
*/
|
*/
|
||||||
protected $allowCustomVars = true;
|
protected $allowCustomVars = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupBase = array('contacts' => array('co.object_id', 'c.contact_id'));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupOrigin = array('hosts', 'services');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
protected $columnMap = array(
|
protected $columnMap = array(
|
||||||
'instances' => array(
|
|
||||||
'instance_name' => 'i.instance_name'
|
|
||||||
),
|
|
||||||
'contacts' => array(
|
'contacts' => array(
|
||||||
'contact_id' => 'c.contact_id',
|
'contact_id' => 'c.contact_id',
|
||||||
'contact' => 'co.name1 COLLATE latin1_general_ci',
|
'contact' => 'co.name1 COLLATE latin1_general_ci',
|
||||||
|
@ -43,10 +50,6 @@ class ContactQuery extends IdoQuery
|
||||||
'contact_notify_host_flapping' => 'c.notify_host_flapping',
|
'contact_notify_host_flapping' => 'c.notify_host_flapping',
|
||||||
'contact_notify_host_downtime' => 'c.notify_host_downtime'
|
'contact_notify_host_downtime' => 'c.notify_host_downtime'
|
||||||
),
|
),
|
||||||
'timeperiods' => array(
|
|
||||||
'contact_notify_host_timeperiod' => 'ht.alias COLLATE latin1_general_ci',
|
|
||||||
'contact_notify_service_timeperiod' => 'st.alias COLLATE latin1_general_ci'
|
|
||||||
),
|
|
||||||
'hostgroups' => array(
|
'hostgroups' => array(
|
||||||
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
|
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
|
||||||
'hostgroup_alias' => 'hg.alias COLLATE latin1_general_ci',
|
'hostgroup_alias' => 'hg.alias COLLATE latin1_general_ci',
|
||||||
|
@ -58,6 +61,9 @@ class ContactQuery extends IdoQuery
|
||||||
'host_alias' => 'h.alias',
|
'host_alias' => 'h.alias',
|
||||||
'host_display_name' => 'h.display_name COLLATE latin1_general_ci'
|
'host_display_name' => 'h.display_name COLLATE latin1_general_ci'
|
||||||
),
|
),
|
||||||
|
'instances' => array(
|
||||||
|
'instance_name' => 'i.instance_name'
|
||||||
|
),
|
||||||
'servicegroups' => array(
|
'servicegroups' => array(
|
||||||
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
|
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
|
||||||
'servicegroup_name' => 'sgo.name1',
|
'servicegroup_name' => 'sgo.name1',
|
||||||
|
@ -68,6 +74,10 @@ class ContactQuery extends IdoQuery
|
||||||
'service_description' => 'so.name2',
|
'service_description' => 'so.name2',
|
||||||
'service_display_name' => 's.display_name COLLATE latin1_general_ci',
|
'service_display_name' => 's.display_name COLLATE latin1_general_ci',
|
||||||
'service_host_name' => 'so.name1'
|
'service_host_name' => 'so.name1'
|
||||||
|
),
|
||||||
|
'timeperiods' => array(
|
||||||
|
'contact_notify_host_timeperiod' => 'ht.alias COLLATE latin1_general_ci',
|
||||||
|
'contact_notify_service_timeperiod' => 'st.alias COLLATE latin1_general_ci'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -87,23 +97,6 @@ class ContactQuery extends IdoQuery
|
||||||
$this->joinedVirtualTables['contacts'] = true;
|
$this->joinedVirtualTables['contacts'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Join timeperiods
|
|
||||||
*/
|
|
||||||
protected function joinTimeperiods()
|
|
||||||
{
|
|
||||||
$this->select->joinLeft(
|
|
||||||
array('ht' => $this->prefix . 'timeperiods'),
|
|
||||||
'ht.timeperiod_object_id = c.host_timeperiod_object_id',
|
|
||||||
array()
|
|
||||||
);
|
|
||||||
$this->select->joinLeft(
|
|
||||||
array('st' => $this->prefix . 'timeperiods'),
|
|
||||||
'st.timeperiod_object_id = c.service_timeperiod_object_id',
|
|
||||||
array()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Join host groups
|
* Join host groups
|
||||||
*/
|
*/
|
||||||
|
@ -145,6 +138,18 @@ class ContactQuery extends IdoQuery
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Join instances
|
||||||
|
*/
|
||||||
|
protected function joinInstances()
|
||||||
|
{
|
||||||
|
$this->select->join(
|
||||||
|
array('i' => $this->prefix . 'instances'),
|
||||||
|
'i.instance_id = c.instance_id',
|
||||||
|
array()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Join service groups
|
* Join service groups
|
||||||
*/
|
*/
|
||||||
|
@ -187,31 +192,19 @@ class ContactQuery extends IdoQuery
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Join instances
|
* Join time periods
|
||||||
*/
|
*/
|
||||||
protected function joinInstances()
|
protected function joinTimeperiods()
|
||||||
{
|
{
|
||||||
$this->select->join(
|
$this->select->joinLeft(
|
||||||
array('i' => $this->prefix . 'instances'),
|
array('ht' => $this->prefix . 'timeperiods'),
|
||||||
'i.instance_id = c.instance_id',
|
'ht.timeperiod_object_id = c.host_timeperiod_object_id',
|
||||||
|
array()
|
||||||
|
);
|
||||||
|
$this->select->joinLeft(
|
||||||
|
array('st' => $this->prefix . 'timeperiods'),
|
||||||
|
'st.timeperiod_object_id = c.service_timeperiod_object_id',
|
||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function getGroup()
|
|
||||||
{
|
|
||||||
$group = array();
|
|
||||||
if ($this->hasJoinedVirtualTable('hosts') || $this->hasJoinedVirtualTable('services')) {
|
|
||||||
$group = array('c.contact_id', 'co.object_id');
|
|
||||||
if ($this->hasJoinedVirtualTable('timeperiods')) {
|
|
||||||
$group[] = 'ht.timeperiod_id';
|
|
||||||
$group[] = 'st.timeperiod_id';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $group;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,13 +13,20 @@ class ContactgroupQuery extends IdoQuery
|
||||||
*/
|
*/
|
||||||
protected $allowCustomVars = true;
|
protected $allowCustomVars = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupBase = array('contactgroups' => array('cg.contactgroup_id', 'cgo.object_id'));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupOrigin = array('contacts', 'hosts', 'services');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
protected $columnMap = array(
|
protected $columnMap = array(
|
||||||
'instances' => array(
|
|
||||||
'instance_name' => 'i.instance_name'
|
|
||||||
),
|
|
||||||
'contactgroups' => array(
|
'contactgroups' => array(
|
||||||
'contactgroup' => 'cgo.name1 COLLATE latin1_general_ci',
|
'contactgroup' => 'cgo.name1 COLLATE latin1_general_ci',
|
||||||
'contactgroup_name' => 'cgo.name1',
|
'contactgroup_name' => 'cgo.name1',
|
||||||
|
@ -59,6 +66,9 @@ class ContactgroupQuery extends IdoQuery
|
||||||
'host_alias' => 'h.alias',
|
'host_alias' => 'h.alias',
|
||||||
'host_display_name' => 'h.display_name COLLATE latin1_general_ci'
|
'host_display_name' => 'h.display_name COLLATE latin1_general_ci'
|
||||||
),
|
),
|
||||||
|
'instances' => array(
|
||||||
|
'instance_name' => 'i.instance_name'
|
||||||
|
),
|
||||||
'servicegroups' => array(
|
'servicegroups' => array(
|
||||||
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
|
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
|
||||||
'servicegroup_name' => 'sgo.name1',
|
'servicegroup_name' => 'sgo.name1',
|
||||||
|
@ -149,6 +159,18 @@ class ContactgroupQuery extends IdoQuery
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Join instances
|
||||||
|
*/
|
||||||
|
protected function joinInstances()
|
||||||
|
{
|
||||||
|
$this->select->join(
|
||||||
|
array('i' => $this->prefix . 'instances'),
|
||||||
|
'i.instance_id = cg.instance_id',
|
||||||
|
array()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Join service groups
|
* Join service groups
|
||||||
*/
|
*/
|
||||||
|
@ -189,40 +211,4 @@ class ContactgroupQuery extends IdoQuery
|
||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Join instances
|
|
||||||
*/
|
|
||||||
protected function joinInstances()
|
|
||||||
{
|
|
||||||
$this->select->join(
|
|
||||||
array('i' => $this->prefix . 'instances'),
|
|
||||||
'i.instance_id = cg.instance_id',
|
|
||||||
array()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function getGroup()
|
|
||||||
{
|
|
||||||
$group = array();
|
|
||||||
if ($this->hasJoinedVirtualTable('hosts') || $this->hasJoinedVirtualTable('services')) {
|
|
||||||
$group = array('cg.contactgroup_id', 'cgo.object_id');
|
|
||||||
if ($this->hasJoinedVirtualTable('contacts')) {
|
|
||||||
$group[] = 'c.contact_id';
|
|
||||||
$group[] = 'co.object_id';
|
|
||||||
}
|
|
||||||
} elseif ($this->hasJoinedVirtualTable('contacts')) {
|
|
||||||
$group = array(
|
|
||||||
'cg.contactgroup_id',
|
|
||||||
'cgo.object_id',
|
|
||||||
'c.contact_id',
|
|
||||||
'co.object_id'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $group;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,13 +13,20 @@ class HostcommentQuery extends IdoQuery
|
||||||
*/
|
*/
|
||||||
protected $allowCustomVars = true;
|
protected $allowCustomVars = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupBase = array('comments' => array('c.comment_id', 'ho.object_id'));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupOrigin = array('hostgroups', 'services');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
protected $columnMap = array(
|
protected $columnMap = array(
|
||||||
'instances' => array(
|
|
||||||
'instance_name' => 'i.instance_name'
|
|
||||||
),
|
|
||||||
'comments' => array(
|
'comments' => array(
|
||||||
'comment_author' => 'c.author_name COLLATE latin1_general_ci',
|
'comment_author' => 'c.author_name COLLATE latin1_general_ci',
|
||||||
'comment_author_name' => 'c.author_name',
|
'comment_author_name' => 'c.author_name',
|
||||||
|
@ -45,6 +52,9 @@ class HostcommentQuery extends IdoQuery
|
||||||
'hoststatus' => array(
|
'hoststatus' => array(
|
||||||
'host_state' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END'
|
'host_state' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END'
|
||||||
),
|
),
|
||||||
|
'instances' => array(
|
||||||
|
'instance_name' => 'i.instance_name'
|
||||||
|
),
|
||||||
'servicegroups' => array(
|
'servicegroups' => array(
|
||||||
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
|
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
|
||||||
'servicegroup_name' => 'sgo.name1',
|
'servicegroup_name' => 'sgo.name1',
|
||||||
|
@ -117,6 +127,18 @@ class HostcommentQuery extends IdoQuery
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Join instances
|
||||||
|
*/
|
||||||
|
protected function joinInstances()
|
||||||
|
{
|
||||||
|
$this->select->join(
|
||||||
|
array('i' => $this->prefix . 'instances'),
|
||||||
|
'i.instance_id = c.instance_id',
|
||||||
|
array()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Join service groups
|
* Join service groups
|
||||||
*/
|
*/
|
||||||
|
@ -153,40 +175,4 @@ class HostcommentQuery extends IdoQuery
|
||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Join instances
|
|
||||||
*/
|
|
||||||
protected function joinInstances()
|
|
||||||
{
|
|
||||||
$this->select->join(
|
|
||||||
array('i' => $this->prefix . 'instances'),
|
|
||||||
'i.instance_id = c.instance_id',
|
|
||||||
array()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function getGroup()
|
|
||||||
{
|
|
||||||
$group = array();
|
|
||||||
if ($this->hasJoinedVirtualTable('hostgroups') || $this->hasJoinedVirtualTable('services')) {
|
|
||||||
$group = array('c.comment_id', 'ho.object_id');
|
|
||||||
if ($this->hasJoinedVirtualTable('hosts')) {
|
|
||||||
$group[] = 'h.host_id';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->hasJoinedVirtualTable('hoststatus')) {
|
|
||||||
$group[] = 'hs.hoststatus_id';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->hasJoinedVirtualTable('instances')) {
|
|
||||||
$group[] = 'i.instance_id';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $group;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,15 +27,15 @@ class HostcommentdeletionhistoryQuery extends HostcommenthistoryQuery
|
||||||
{
|
{
|
||||||
parent::joinBaseTables();
|
parent::joinBaseTables();
|
||||||
$this->select->where("hch.deletion_time > '1970-01-02 00:00:00'");
|
$this->select->where("hch.deletion_time > '1970-01-02 00:00:00'");
|
||||||
$this->columnMap['history']['timestamp'] = str_replace(
|
$this->columnMap['commenthistory']['timestamp'] = str_replace(
|
||||||
'comment_time',
|
'comment_time',
|
||||||
'deletion_time',
|
'deletion_time',
|
||||||
$this->columnMap['history']['timestamp']
|
$this->columnMap['commenthistory']['timestamp']
|
||||||
);
|
);
|
||||||
$this->columnMap['history']['type'] = str_replace(
|
$this->columnMap['commenthistory']['type'] = str_replace(
|
||||||
'END)',
|
'END)',
|
||||||
"END || '_deleted')",
|
"END || '_deleted')",
|
||||||
$this->columnMap['history']['type']
|
$this->columnMap['commenthistory']['type']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,24 +13,29 @@ class HostcommenthistoryQuery extends IdoQuery
|
||||||
*/
|
*/
|
||||||
protected $allowCustomVars = true;
|
protected $allowCustomVars = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupBase = array('commenthistory' => array('hch.commenthistory_id', 'ho.object_id'));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupOrigin = array('hostgroups', 'services');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
protected $columnMap = array(
|
protected $columnMap = array(
|
||||||
'instances' => array(
|
|
||||||
'instance_name' => 'i.instance_name'
|
|
||||||
),
|
|
||||||
'commenthistory' => array(
|
'commenthistory' => array(
|
||||||
'host' => 'ho.name1 COLLATE latin1_general_ci',
|
'host' => 'ho.name1 COLLATE latin1_general_ci',
|
||||||
'host_name' => 'ho.name1',
|
'host_name' => 'ho.name1',
|
||||||
'object_type' => '(\'host\')'
|
'object_id' => 'hch.object_id',
|
||||||
),
|
'object_type' => '(\'host\')',
|
||||||
'history' => array(
|
'output' => "('[' || hch.author_name || '] ' || hch.comment_data)",
|
||||||
'type' => "(CASE hch.entry_type WHEN 1 THEN 'comment' WHEN 2 THEN 'dt_comment' WHEN 3 THEN 'flapping' WHEN 4 THEN 'ack' END)",
|
'state' => '(-1)',
|
||||||
'timestamp' => 'UNIX_TIMESTAMP(hch.comment_time)',
|
'timestamp' => 'UNIX_TIMESTAMP(hch.comment_time)',
|
||||||
'object_id' => 'hch.object_id',
|
'type' => "(CASE hch.entry_type WHEN 1 THEN 'comment' WHEN 2 THEN 'dt_comment' WHEN 3 THEN 'flapping' WHEN 4 THEN 'ack' END)"
|
||||||
'state' => '(-1)',
|
|
||||||
'output' => "('[' || hch.author_name || '] ' || hch.comment_data)",
|
|
||||||
),
|
),
|
||||||
'hostgroups' => array(
|
'hostgroups' => array(
|
||||||
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
|
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
|
||||||
|
@ -41,6 +46,9 @@ class HostcommenthistoryQuery extends IdoQuery
|
||||||
'host_alias' => 'h.alias',
|
'host_alias' => 'h.alias',
|
||||||
'host_display_name' => 'h.display_name COLLATE latin1_general_ci'
|
'host_display_name' => 'h.display_name COLLATE latin1_general_ci'
|
||||||
),
|
),
|
||||||
|
'instances' => array(
|
||||||
|
'instance_name' => 'i.instance_name'
|
||||||
|
),
|
||||||
'servicegroups' => array(
|
'servicegroups' => array(
|
||||||
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
|
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
|
||||||
'servicegroup_name' => 'sgo.name1',
|
'servicegroup_name' => 'sgo.name1',
|
||||||
|
@ -80,7 +88,6 @@ class HostcommenthistoryQuery extends IdoQuery
|
||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
$this->joinedVirtualTables['commenthistory'] = true;
|
$this->joinedVirtualTables['commenthistory'] = true;
|
||||||
$this->joinedVirtualTables['history'] = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -115,6 +122,18 @@ class HostcommenthistoryQuery extends IdoQuery
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Join instances
|
||||||
|
*/
|
||||||
|
protected function joinInstances()
|
||||||
|
{
|
||||||
|
$this->select->join(
|
||||||
|
array('i' => $this->prefix . 'instances'),
|
||||||
|
'i.instance_id = hch.instance_id',
|
||||||
|
array()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Join service groups
|
* Join service groups
|
||||||
*/
|
*/
|
||||||
|
@ -151,32 +170,4 @@ class HostcommenthistoryQuery extends IdoQuery
|
||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Join instances
|
|
||||||
*/
|
|
||||||
protected function joinInstances()
|
|
||||||
{
|
|
||||||
$this->select->join(
|
|
||||||
array('i' => $this->prefix . 'instances'),
|
|
||||||
'i.instance_id = hch.instance_id',
|
|
||||||
array()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function getGroup()
|
|
||||||
{
|
|
||||||
$group = array();
|
|
||||||
if ($this->hasJoinedVirtualTable('hostgroups') || $this->hasJoinedVirtualTable('services')) {
|
|
||||||
$group = array('hch.commenthistory_id', 'ho.object_id');
|
|
||||||
if ($this->hasJoinedVirtualTable('hosts')) {
|
|
||||||
$group[] = 'h.host_id';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $group;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,13 +13,20 @@ class HostdowntimeQuery extends IdoQuery
|
||||||
*/
|
*/
|
||||||
protected $allowCustomVars = true;
|
protected $allowCustomVars = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupBase = array('downtimes' => array('sd.scheduleddowntime_id', 'ho.object_id'));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupOrigin = array('hostgroups', 'servicegroups', 'services');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
protected $columnMap = array(
|
protected $columnMap = array(
|
||||||
'instances' => array(
|
|
||||||
'instance_name' => 'i.instance_name'
|
|
||||||
),
|
|
||||||
'downtimes' => array(
|
'downtimes' => array(
|
||||||
'downtime_author' => 'sd.author_name COLLATE latin1_general_ci',
|
'downtime_author' => 'sd.author_name COLLATE latin1_general_ci',
|
||||||
'downtime_author_name' => 'sd.author_name',
|
'downtime_author_name' => 'sd.author_name',
|
||||||
|
@ -51,6 +58,9 @@ class HostdowntimeQuery extends IdoQuery
|
||||||
'hoststatus' => array(
|
'hoststatus' => array(
|
||||||
'host_state' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END'
|
'host_state' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END'
|
||||||
),
|
),
|
||||||
|
'instances' => array(
|
||||||
|
'instance_name' => 'i.instance_name'
|
||||||
|
),
|
||||||
'servicegroups' => array(
|
'servicegroups' => array(
|
||||||
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
|
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
|
||||||
'servicegroup_name' => 'sgo.name1',
|
'servicegroup_name' => 'sgo.name1',
|
||||||
|
@ -123,6 +133,18 @@ class HostdowntimeQuery extends IdoQuery
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Join instances
|
||||||
|
*/
|
||||||
|
protected function joinInstances()
|
||||||
|
{
|
||||||
|
$this->select->join(
|
||||||
|
array('i' => $this->prefix . 'instances'),
|
||||||
|
'i.instance_id = sd.instance_id',
|
||||||
|
array()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Join service groups
|
* Join service groups
|
||||||
*/
|
*/
|
||||||
|
@ -159,40 +181,4 @@ class HostdowntimeQuery extends IdoQuery
|
||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Join instances
|
|
||||||
*/
|
|
||||||
protected function joinInstances()
|
|
||||||
{
|
|
||||||
$this->select->join(
|
|
||||||
array('i' => $this->prefix . 'instances'),
|
|
||||||
'i.instance_id = sd.instance_id',
|
|
||||||
array()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function getGroup()
|
|
||||||
{
|
|
||||||
$group = array();
|
|
||||||
if ($this->hasJoinedVirtualTable('hostgroups') || $this->hasJoinedVirtualTable('servicegroups') || $this->hasJoinedVirtualTable('services')) {
|
|
||||||
$group = array('sd.scheduleddowntime_id', 'ho.object_id');
|
|
||||||
if ($this->hasJoinedVirtualTable('hosts')) {
|
|
||||||
$group[] = 'h.host_id';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->hasJoinedVirtualTable('hoststatus')) {
|
|
||||||
$group[] = 'hs.hoststatus_id';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->hasJoinedVirtualTable('instances')) {
|
|
||||||
$group[] = 'i.instance_id';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $group;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,11 +29,11 @@ class HostdowntimeendhistoryQuery extends HostdowntimestarthistoryQuery
|
||||||
{
|
{
|
||||||
parent::joinBaseTables(true);
|
parent::joinBaseTables(true);
|
||||||
$this->select->where("hdh.actual_end_time > '1970-01-02 00:00:00'");
|
$this->select->where("hdh.actual_end_time > '1970-01-02 00:00:00'");
|
||||||
$this->columnMap['history']['type'] = "('dt_end')";
|
$this->columnMap['downtimehistory']['type'] = "('dt_end')";
|
||||||
$this->columnMap['history']['timestamp'] = str_replace(
|
$this->columnMap['downtimehistory']['timestamp'] = str_replace(
|
||||||
'actual_start_time',
|
'actual_start_time',
|
||||||
'actual_end_time',
|
'actual_end_time',
|
||||||
$this->columnMap['history']['timestamp']
|
$this->columnMap['downtimehistory']['timestamp']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,24 +13,29 @@ class HostdowntimestarthistoryQuery extends IdoQuery
|
||||||
*/
|
*/
|
||||||
protected $allowCustomVars = true;
|
protected $allowCustomVars = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupBase = array('downtimehistory' => array('hdh.downtimehistory_id', 'ho.object_id'));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupOrigin = array('hostgroups', 'services');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
protected $columnMap = array(
|
protected $columnMap = array(
|
||||||
'instances' => array(
|
|
||||||
'instance_name' => 'i.instance_name'
|
|
||||||
),
|
|
||||||
'downtimehistory' => array(
|
'downtimehistory' => array(
|
||||||
'host' => 'ho.name1 COLLATE latin1_general_ci',
|
'host' => 'ho.name1 COLLATE latin1_general_ci',
|
||||||
'host_name' => 'ho.name1',
|
'host_name' => 'ho.name1',
|
||||||
'object_type' => '(\'host\')'
|
'object_id' => 'hdh.object_id',
|
||||||
),
|
'object_type' => '(\'host\')',
|
||||||
'history' => array(
|
'output' => "('[' || hdh.author_name || '] ' || hdh.comment_data)",
|
||||||
'type' => "('dt_start')",
|
'state' => '(-1)',
|
||||||
'timestamp' => 'UNIX_TIMESTAMP(hdh.actual_start_time)',
|
'timestamp' => 'UNIX_TIMESTAMP(hdh.actual_start_time)',
|
||||||
'object_id' => 'hdh.object_id',
|
'type' => "('dt_start')"
|
||||||
'state' => '(-1)',
|
|
||||||
'output' => "('[' || hdh.author_name || '] ' || hdh.comment_data)",
|
|
||||||
),
|
),
|
||||||
'hostgroups' => array(
|
'hostgroups' => array(
|
||||||
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
|
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
|
||||||
|
@ -41,6 +46,9 @@ class HostdowntimestarthistoryQuery extends IdoQuery
|
||||||
'host_alias' => 'h.alias',
|
'host_alias' => 'h.alias',
|
||||||
'host_display_name' => 'h.display_name COLLATE latin1_general_ci'
|
'host_display_name' => 'h.display_name COLLATE latin1_general_ci'
|
||||||
),
|
),
|
||||||
|
'instances' => array(
|
||||||
|
'instance_name' => 'i.instance_name'
|
||||||
|
),
|
||||||
'servicegroups' => array(
|
'servicegroups' => array(
|
||||||
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
|
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
|
||||||
'servicegroup_name' => 'sgo.name1',
|
'servicegroup_name' => 'sgo.name1',
|
||||||
|
@ -89,7 +97,6 @@ class HostdowntimestarthistoryQuery extends IdoQuery
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->joinedVirtualTables['downtimehistory'] = true;
|
$this->joinedVirtualTables['downtimehistory'] = true;
|
||||||
$this->joinedVirtualTables['history'] = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -124,6 +131,18 @@ class HostdowntimestarthistoryQuery extends IdoQuery
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Join instances
|
||||||
|
*/
|
||||||
|
protected function joinInstances()
|
||||||
|
{
|
||||||
|
$this->select->join(
|
||||||
|
array('i' => $this->prefix . 'instances'),
|
||||||
|
'i.instance_id = hdh.instance_id',
|
||||||
|
array()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Join service groups
|
* Join service groups
|
||||||
*/
|
*/
|
||||||
|
@ -160,32 +179,4 @@ class HostdowntimestarthistoryQuery extends IdoQuery
|
||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Join instances
|
|
||||||
*/
|
|
||||||
protected function joinInstances()
|
|
||||||
{
|
|
||||||
$this->select->join(
|
|
||||||
array('i' => $this->prefix . 'instances'),
|
|
||||||
'i.instance_id = hdh.instance_id',
|
|
||||||
array()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function getGroup()
|
|
||||||
{
|
|
||||||
$group = array();
|
|
||||||
if ($this->hasJoinedVirtualTable('hostgroups') || $this->hasJoinedVirtualTable('services')) {
|
|
||||||
$group = array('hdh.downtimehistory_id', 'ho.object_id');
|
|
||||||
if ($this->hasJoinedVirtualTable('hosts')) {
|
|
||||||
$group[] = 'h.host_id';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $group;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,13 +13,20 @@ class HostgroupQuery extends IdoQuery
|
||||||
*/
|
*/
|
||||||
protected $allowCustomVars = true;
|
protected $allowCustomVars = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupBase = array('hostgroups' => array('hg.hostgroup_id', 'hgo.object_id'));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupOrigin = array('hostobjects');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
protected $columnMap = array(
|
protected $columnMap = array(
|
||||||
'instances' => array(
|
|
||||||
'instance_name' => 'i.instance_name'
|
|
||||||
),
|
|
||||||
'hostgroups' => array(
|
'hostgroups' => array(
|
||||||
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
|
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
|
||||||
'hostgroup_alias' => 'hg.alias COLLATE latin1_general_ci',
|
'hostgroup_alias' => 'hg.alias COLLATE latin1_general_ci',
|
||||||
|
@ -33,6 +40,9 @@ class HostgroupQuery extends IdoQuery
|
||||||
'host_alias' => 'h.alias',
|
'host_alias' => 'h.alias',
|
||||||
'host_display_name' => 'h.display_name COLLATE latin1_general_ci',
|
'host_display_name' => 'h.display_name COLLATE latin1_general_ci',
|
||||||
),
|
),
|
||||||
|
'instances' => array(
|
||||||
|
'instance_name' => 'i.instance_name'
|
||||||
|
),
|
||||||
'servicegroups' => array(
|
'servicegroups' => array(
|
||||||
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
|
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
|
||||||
'servicegroup_alias' => 'sg.alias COLLATE latin1_general_ci',
|
'servicegroup_alias' => 'sg.alias COLLATE latin1_general_ci',
|
||||||
|
@ -91,6 +101,18 @@ class HostgroupQuery extends IdoQuery
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Join instances
|
||||||
|
*/
|
||||||
|
protected function joinInstances()
|
||||||
|
{
|
||||||
|
$this->select->join(
|
||||||
|
array('i' => $this->prefix . 'instances'),
|
||||||
|
'i.instance_id = hg.instance_id',
|
||||||
|
array()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Join service groups
|
* Join service groups
|
||||||
*/
|
*/
|
||||||
|
@ -128,29 +150,4 @@ class HostgroupQuery extends IdoQuery
|
||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Join instances
|
|
||||||
*/
|
|
||||||
protected function joinInstances()
|
|
||||||
{
|
|
||||||
$this->select->join(
|
|
||||||
array('i' => $this->prefix . 'instances'),
|
|
||||||
'i.instance_id = hg.instance_id',
|
|
||||||
array()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function getGroup()
|
|
||||||
{
|
|
||||||
$group = array();
|
|
||||||
if ($this->hasJoinedVirtualTable('hostobjects')) {
|
|
||||||
$group = array('hg.hostgroup_id', 'hgo.object_id');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $group;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,8 +55,10 @@ class HostserviceproblemsummaryQuery extends IdoQuery
|
||||||
public function setHoststatusQuery(HoststatusQuery $query)
|
public function setHoststatusQuery(HoststatusQuery $query)
|
||||||
{
|
{
|
||||||
$this->hostStatusQuery = clone $query;
|
$this->hostStatusQuery = clone $query;
|
||||||
$this->hostStatusQuery->setIsSubQuery();
|
$this->hostStatusQuery
|
||||||
$this->hostStatusQuery->columns(array('object_id'));
|
->clearOrder()
|
||||||
|
->setIsSubQuery()
|
||||||
|
->columns(array('object_id'));
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,12 +72,10 @@ class HostserviceproblemsummaryQuery extends IdoQuery
|
||||||
array()
|
array()
|
||||||
)->join(
|
)->join(
|
||||||
array('s' => $this->prefix . 'services'),
|
array('s' => $this->prefix . 'services'),
|
||||||
's.service_object_id = so.object_id',
|
's.service_object_id = so.object_id AND so.is_active = 1',
|
||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
|
$this->select->group(array('so.object_id'));
|
||||||
$this->select->group(array('so.name1'));
|
|
||||||
$this->select->where('so.is_active = 1');
|
|
||||||
$this->joinedVirtualTables['services'] = true;
|
$this->joinedVirtualTables['services'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,16 @@ class HoststatehistoryQuery extends IdoQuery
|
||||||
*/
|
*/
|
||||||
protected $allowCustomVars = true;
|
protected $allowCustomVars = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupBase = array('statehistory' => array('hh.statehistory_id', 'ho.object_id'));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupOrigin = array('hostgroups', 'services');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Array to map type names to type ids for query optimization
|
* Array to map type names to type ids for query optimization
|
||||||
*
|
*
|
||||||
|
@ -27,21 +37,6 @@ class HoststatehistoryQuery extends IdoQuery
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
protected $columnMap = array(
|
protected $columnMap = array(
|
||||||
'instances' => array(
|
|
||||||
'instance_name' => 'i.instance_name'
|
|
||||||
),
|
|
||||||
'statehistory' => array(
|
|
||||||
'host' => 'ho.name1 COLLATE latin1_general_ci',
|
|
||||||
'host_name' => 'ho.name1',
|
|
||||||
'object_type' => '(\'host\')'
|
|
||||||
),
|
|
||||||
'history' => array(
|
|
||||||
'type' => "(CASE WHEN hh.state_type = 1 THEN 'hard_state' ELSE 'soft_state' END)",
|
|
||||||
'timestamp' => 'UNIX_TIMESTAMP(hh.state_time)',
|
|
||||||
'object_id' => 'hh.object_id',
|
|
||||||
'state' => 'hh.state',
|
|
||||||
'output' => "('[ ' || hh.current_check_attempt || '/' || hh.max_check_attempts || ' ] ' || hh.output)",
|
|
||||||
),
|
|
||||||
'hostgroups' => array(
|
'hostgroups' => array(
|
||||||
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
|
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
|
||||||
'hostgroup_alias' => 'hg.alias COLLATE latin1_general_ci',
|
'hostgroup_alias' => 'hg.alias COLLATE latin1_general_ci',
|
||||||
|
@ -51,6 +46,9 @@ class HoststatehistoryQuery extends IdoQuery
|
||||||
'host_alias' => 'h.alias',
|
'host_alias' => 'h.alias',
|
||||||
'host_display_name' => 'h.display_name COLLATE latin1_general_ci'
|
'host_display_name' => 'h.display_name COLLATE latin1_general_ci'
|
||||||
),
|
),
|
||||||
|
'instances' => array(
|
||||||
|
'instance_name' => 'i.instance_name'
|
||||||
|
),
|
||||||
'servicegroups' => array(
|
'servicegroups' => array(
|
||||||
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
|
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
|
||||||
'servicegroup_name' => 'sgo.name1',
|
'servicegroup_name' => 'sgo.name1',
|
||||||
|
@ -61,7 +59,17 @@ class HoststatehistoryQuery extends IdoQuery
|
||||||
'service_description' => 'so.name2',
|
'service_description' => 'so.name2',
|
||||||
'service_display_name' => 's.display_name COLLATE latin1_general_ci',
|
'service_display_name' => 's.display_name COLLATE latin1_general_ci',
|
||||||
'service_host_name' => 'so.name1'
|
'service_host_name' => 'so.name1'
|
||||||
)
|
),
|
||||||
|
'statehistory' => array(
|
||||||
|
'host' => 'ho.name1 COLLATE latin1_general_ci',
|
||||||
|
'host_name' => 'ho.name1',
|
||||||
|
'object_id' => 'hh.object_id',
|
||||||
|
'object_type' => '(\'host\')',
|
||||||
|
'output' => "('[ ' || hh.current_check_attempt || '/' || hh.max_check_attempts || ' ] ' || hh.output)",
|
||||||
|
'state' => 'hh.state',
|
||||||
|
'timestamp' => 'UNIX_TIMESTAMP(hh.state_time)',
|
||||||
|
'type' => "(CASE WHEN hh.state_type = 1 THEN 'hard_state' ELSE 'soft_state' END)"
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -72,7 +80,7 @@ class HoststatehistoryQuery extends IdoQuery
|
||||||
if ($col === 'UNIX_TIMESTAMP(hh.state_time)') {
|
if ($col === 'UNIX_TIMESTAMP(hh.state_time)') {
|
||||||
return 'hh.state_time ' . $sign . ' ' . $this->timestampForSql($this->valueToTimestamp($expression));
|
return 'hh.state_time ' . $sign . ' ' . $this->timestampForSql($this->valueToTimestamp($expression));
|
||||||
} elseif (
|
} elseif (
|
||||||
$col === $this->columnMap['history']['type']
|
$col === $this->columnMap['statehistory']['type']
|
||||||
&& ! is_array($expression)
|
&& ! is_array($expression)
|
||||||
&& array_key_exists($expression, $this->types)
|
&& array_key_exists($expression, $this->types)
|
||||||
) {
|
) {
|
||||||
|
@ -96,7 +104,6 @@ class HoststatehistoryQuery extends IdoQuery
|
||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
$this->joinedVirtualTables['statehistory'] = true;
|
$this->joinedVirtualTables['statehistory'] = true;
|
||||||
$this->joinedVirtualTables['history'] = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -131,6 +138,18 @@ class HoststatehistoryQuery extends IdoQuery
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Join instances
|
||||||
|
*/
|
||||||
|
protected function joinInstances()
|
||||||
|
{
|
||||||
|
$this->select->join(
|
||||||
|
array('i' => $this->prefix . 'instances'),
|
||||||
|
'i.instance_id = hh.instance_id',
|
||||||
|
array()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Join service groups
|
* Join service groups
|
||||||
*/
|
*/
|
||||||
|
@ -167,32 +186,4 @@ class HoststatehistoryQuery extends IdoQuery
|
||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Join instances
|
|
||||||
*/
|
|
||||||
protected function joinInstances()
|
|
||||||
{
|
|
||||||
$this->select->join(
|
|
||||||
array('i' => $this->prefix . 'instances'),
|
|
||||||
'i.instance_id = hh.instance_id',
|
|
||||||
array()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function getGroup()
|
|
||||||
{
|
|
||||||
$group = array();
|
|
||||||
if ($this->hasJoinedVirtualTable('hostgroups') || $this->hasJoinedVirtualTable('services')) {
|
|
||||||
$group = array('hh.statehistory_id', 'ho.object_id');
|
|
||||||
if ($this->hasJoinedVirtualTable('hosts')) {
|
|
||||||
$group[] = 'h.host_id';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $group;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,12 +12,22 @@ class HoststatusQuery extends IdoQuery
|
||||||
*/
|
*/
|
||||||
protected $allowCustomVars = true;
|
protected $allowCustomVars = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupBase = array('hosts' => array('ho.object_id', 'h.host_id'));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupOrigin = array('hostgroups', 'servicegroups', 'services');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
protected $columnMap = array(
|
protected $columnMap = array(
|
||||||
'instances' => array(
|
'checktimeperiods' => array(
|
||||||
'instance_name' => 'i.instance_name'
|
'host_check_timeperiod' => 'ctp.alias COLLATE latin1_general_ci'
|
||||||
),
|
),
|
||||||
'hostgroups' => array(
|
'hostgroups' => array(
|
||||||
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
|
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
|
||||||
|
@ -149,6 +159,9 @@ class HoststatusQuery extends IdoQuery
|
||||||
'host_status_update_time' => 'hs.status_update_time',
|
'host_status_update_time' => 'hs.status_update_time',
|
||||||
'host_unhandled' => 'CASE WHEN (hs.problem_has_been_acknowledged + hs.scheduled_downtime_depth) = 0 THEN 1 ELSE 0 END'
|
'host_unhandled' => 'CASE WHEN (hs.problem_has_been_acknowledged + hs.scheduled_downtime_depth) = 0 THEN 1 ELSE 0 END'
|
||||||
),
|
),
|
||||||
|
'instances' => array(
|
||||||
|
'instance_name' => 'i.instance_name'
|
||||||
|
),
|
||||||
'servicegroups' => array(
|
'servicegroups' => array(
|
||||||
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
|
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
|
||||||
'servicegroup_name' => 'sgo.name1',
|
'servicegroup_name' => 'sgo.name1',
|
||||||
|
@ -158,9 +171,6 @@ class HoststatusQuery extends IdoQuery
|
||||||
'service' => 'so.name2 COLLATE latin1_general_ci',
|
'service' => 'so.name2 COLLATE latin1_general_ci',
|
||||||
'service_description' => 'so.name2',
|
'service_description' => 'so.name2',
|
||||||
'service_display_name' => 's.display_name COLLATE latin1_general_ci',
|
'service_display_name' => 's.display_name COLLATE latin1_general_ci',
|
||||||
),
|
|
||||||
'checktimeperiods' => array(
|
|
||||||
'host_check_timeperiod' => 'ctp.alias COLLATE latin1_general_ci'
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -188,6 +198,18 @@ class HoststatusQuery extends IdoQuery
|
||||||
$this->joinedVirtualTables['hosts'] = true;
|
$this->joinedVirtualTables['hosts'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Join check time periods
|
||||||
|
*/
|
||||||
|
protected function joinChecktimeperiods()
|
||||||
|
{
|
||||||
|
$this->select->joinLeft(
|
||||||
|
array('ctp' => $this->prefix . 'timeperiods'),
|
||||||
|
'ctp.timeperiod_object_id = h.check_timeperiod_object_id',
|
||||||
|
array()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Join host groups
|
* Join host groups
|
||||||
*/
|
*/
|
||||||
|
@ -220,6 +242,18 @@ class HoststatusQuery extends IdoQuery
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Join instances
|
||||||
|
*/
|
||||||
|
protected function joinInstances()
|
||||||
|
{
|
||||||
|
$this->select->join(
|
||||||
|
array('i' => $this->prefix . 'instances'),
|
||||||
|
'i.instance_id = ho.instance_id',
|
||||||
|
array()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Join service groups
|
* Join service groups
|
||||||
*/
|
*/
|
||||||
|
@ -258,97 +292,6 @@ class HoststatusQuery extends IdoQuery
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Join instances
|
|
||||||
*/
|
|
||||||
protected function joinInstances()
|
|
||||||
{
|
|
||||||
$this->select->join(
|
|
||||||
array('i' => $this->prefix . 'instances'),
|
|
||||||
'i.instance_id = ho.instance_id',
|
|
||||||
array()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function joinChecktimeperiods()
|
|
||||||
{
|
|
||||||
$this->select->joinLeft(
|
|
||||||
array('ctp' => $this->prefix . 'timeperiods'),
|
|
||||||
'ctp.timeperiod_object_id = h.check_timeperiod_object_id',
|
|
||||||
array()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function getGroup()
|
|
||||||
{
|
|
||||||
$group = parent::getGroup() ?: array();
|
|
||||||
if (! is_array($group)) {
|
|
||||||
$group = array($group);
|
|
||||||
}
|
|
||||||
$groupedTables = array();
|
|
||||||
if ($this->hasJoinedVirtualTable('servicegroups')) {
|
|
||||||
$group[] = 'ho.object_id';
|
|
||||||
$group[] = 'h.host_id';
|
|
||||||
$groupedTables['hosts'] = true;
|
|
||||||
$serviceGroupColumns = array_keys($this->columnMap['servicegroups']);
|
|
||||||
$selectedServiceGroupColumns = array_intersect($serviceGroupColumns, array_keys($this->columns));
|
|
||||||
if (! empty($selectedServiceGroupColumns)) {
|
|
||||||
$group[] = 'sgo.object_id';
|
|
||||||
$group[] = 'sg.servicegroup_id';
|
|
||||||
$groupedTables['servicegroups'] = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($this->hasJoinedVirtualTable('hostgroups')) {
|
|
||||||
if (! isset($groupedTables['hosts'])) {
|
|
||||||
$group[] = 'ho.object_id';
|
|
||||||
$group[] = 'h.host_id';
|
|
||||||
$groupedTables['hosts'] = true;
|
|
||||||
}
|
|
||||||
$hostGroupColumns = array_keys($this->columnMap['hostgroups']);
|
|
||||||
$selectedHostGroupColumns = array_intersect($hostGroupColumns, array_keys($this->columns));
|
|
||||||
if (! empty($selectedHostGroupColumns)) {
|
|
||||||
$group[] = 'hgo.object_id';
|
|
||||||
$group[] = 'hg.hostgroup_id';
|
|
||||||
$groupedTables['hostgroups'] = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (! empty($groupedTables)) {
|
|
||||||
foreach ($this->columns as $alias => $column) {
|
|
||||||
if ($column instanceof Zend_Db_Expr || $column === '(NULL)') {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$tableName = $this->aliasToTableName(
|
|
||||||
$this->hasAliasName($alias) ? $alias : $this->customAliasToAlias($alias)
|
|
||||||
);
|
|
||||||
if (isset($groupedTables[$tableName])) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
switch ($tableName) {
|
|
||||||
case 'hoststatus':
|
|
||||||
$group[] = 'hs.hoststatus_id';
|
|
||||||
break;
|
|
||||||
case 'serviceproblemsummary':
|
|
||||||
$group[] = 'sps.unhandled_services_count';
|
|
||||||
break;
|
|
||||||
case 'services':
|
|
||||||
$group[] = 'so.object_id';
|
|
||||||
$group[] = 's.service_id';
|
|
||||||
break;
|
|
||||||
case 'instances':
|
|
||||||
$group[] = 'i.instance_id';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
continue 2;
|
|
||||||
}
|
|
||||||
$groupedTables[$tableName] = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $group;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Query the service problem summary for all hosts of this query's result set
|
* Query the service problem summary for all hosts of this query's result set
|
||||||
*
|
*
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
|
|
||||||
namespace Icinga\Module\Monitoring\Backend\Ido\Query;
|
namespace Icinga\Module\Monitoring\Backend\Ido\Query;
|
||||||
|
|
||||||
|
use AppendIterator;
|
||||||
|
use ArrayIterator;
|
||||||
use Zend_Db_Expr;
|
use Zend_Db_Expr;
|
||||||
use Icinga\Application\Icinga;
|
use Icinga\Application\Icinga;
|
||||||
use Icinga\Application\Logger;
|
use Icinga\Application\Logger;
|
||||||
|
@ -10,9 +12,9 @@ use Icinga\Data\Db\DbQuery;
|
||||||
use Icinga\Data\Filter\Filter;
|
use Icinga\Data\Filter\Filter;
|
||||||
use Icinga\Data\Filter\FilterExpression;
|
use Icinga\Data\Filter\FilterExpression;
|
||||||
use Icinga\Exception\IcingaException;
|
use Icinga\Exception\IcingaException;
|
||||||
use Icinga\Exception\NotImplementedError;
|
|
||||||
use Icinga\Exception\ProgrammingError;
|
use Icinga\Exception\ProgrammingError;
|
||||||
use Icinga\Exception\QueryException;
|
use Icinga\Exception\QueryException;
|
||||||
|
use Icinga\Module\Monitoring\Data\ColumnFilterIterator;
|
||||||
use Icinga\Web\Session;
|
use Icinga\Web\Session;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -119,6 +121,27 @@ abstract class IdoQuery extends DbQuery
|
||||||
*/
|
*/
|
||||||
protected $joinedVirtualTables = array();
|
protected $joinedVirtualTables = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unresolved order columns
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $orderColumns = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Table to columns map which have to be added to the GROUP BY list if the query is grouped
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $groupBase = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of table names which initiate grouping if one of them is joined
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $groupOrigin = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The primary key column for the instances table
|
* The primary key column for the instances table
|
||||||
*
|
*
|
||||||
|
@ -408,6 +431,7 @@ abstract class IdoQuery extends DbQuery
|
||||||
public function order($columnOrAlias, $dir = null)
|
public function order($columnOrAlias, $dir = null)
|
||||||
{
|
{
|
||||||
$this->requireColumn($columnOrAlias);
|
$this->requireColumn($columnOrAlias);
|
||||||
|
$this->orderColumns[$columnOrAlias] = $columnOrAlias;
|
||||||
if ($this->isCustomvar($columnOrAlias)) {
|
if ($this->isCustomvar($columnOrAlias)) {
|
||||||
$columnOrAlias = $this->getCustomvarColumnName($columnOrAlias);
|
$columnOrAlias = $this->getCustomvarColumnName($columnOrAlias);
|
||||||
} elseif ($this->hasAliasName($columnOrAlias)) {
|
} elseif ($this->hasAliasName($columnOrAlias)) {
|
||||||
|
@ -946,46 +970,108 @@ abstract class IdoQuery extends DbQuery
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle grouping for special columns, e.g. when the column sources more than one table
|
||||||
|
*
|
||||||
|
* @param string $column Column
|
||||||
|
* @param array $groupColumns GROUP BY list
|
||||||
|
* @param array $groupedTables Already grouped tables
|
||||||
|
*
|
||||||
|
* @return bool Whether the column was handled
|
||||||
|
*/
|
||||||
|
protected function handleGroupColumn($column, &$groupColumns, &$groupedTables) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function _getGroup()
|
public function getGroup()
|
||||||
{
|
{
|
||||||
throw new NotImplementedError('Does not work in its current state but will, probably, in the future');
|
$group = parent::getGroup() ?: array();
|
||||||
|
if (! is_array($group)) {
|
||||||
// TODO: order by??
|
$group = array($group);
|
||||||
$group = parent::getGroup();
|
}
|
||||||
if (! empty($group) && $this->ds->getDbType() === 'pgsql') {
|
foreach ($this->groupOrigin as $table) {
|
||||||
$group = is_array($group) ? $group : array($group);
|
if ($this->hasJoinedVirtualTable($table)) {
|
||||||
foreach ($this->columns as $alias => $column) {
|
$groupedTables = array();
|
||||||
if ($column instanceof Zend_Db_Expr) {
|
foreach ($this->groupBase as $table => $columns) {
|
||||||
continue;
|
foreach ($columns as $column) {
|
||||||
|
$group[] = $column;
|
||||||
|
}
|
||||||
|
$groupedTables[$table] = true;
|
||||||
|
}
|
||||||
|
if ($this->getDatasource()->getDbType() !== 'pgsql') {
|
||||||
|
return $group;
|
||||||
|
}
|
||||||
|
$columnIterator = new AppendIterator();
|
||||||
|
$columnIterator->append(new ColumnFilterIterator($this->columns));
|
||||||
|
$columnIterator->append(new ArrayIterator($this->orderColumns));
|
||||||
|
foreach ($columnIterator as $alias => $column) {
|
||||||
|
$alias = $this->hasAliasName($alias) ? $alias : $this->customAliasToAlias($alias);
|
||||||
|
if ($this->handleGroupColumn($alias, $group, $groupedTables) === true) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$tableName = $this->aliasToTableName($alias);
|
||||||
|
if (isset($groupedTables[$tableName])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
switch ($tableName) {
|
||||||
|
case 'checktimeperiods':
|
||||||
|
$group[] = 'ctp.timeperiod_id';
|
||||||
|
break;
|
||||||
|
case 'contacts':
|
||||||
|
$group[] = 'co.object_id';
|
||||||
|
$group[] = 'c.contact_id';
|
||||||
|
break;
|
||||||
|
case 'hostobjects':
|
||||||
|
$group[] = 'ho.object_id';
|
||||||
|
break;
|
||||||
|
case 'hosts':
|
||||||
|
$group[] = 'h.host_id';
|
||||||
|
break;
|
||||||
|
case 'hostgroups':
|
||||||
|
$group[] = 'hgo.object_id';
|
||||||
|
$group[] = 'hg.hostgroup_id';
|
||||||
|
break;
|
||||||
|
case 'hoststatus':
|
||||||
|
$group[] = 'hs.hoststatus_id';
|
||||||
|
break;
|
||||||
|
case 'instances':
|
||||||
|
$group[] = 'i.instance_id';
|
||||||
|
break;
|
||||||
|
case 'servicegroups':
|
||||||
|
$group[] = 'sgo.object_id';
|
||||||
|
$group[] = 'sg.servicegroup_id';
|
||||||
|
break;
|
||||||
|
case 'serviceobjects':
|
||||||
|
$group[] = 'so.object_id';
|
||||||
|
break;
|
||||||
|
case 'serviceproblemsummary':
|
||||||
|
$group[] = 'sps.unhandled_services_count';
|
||||||
|
break;
|
||||||
|
case 'services':
|
||||||
|
$group[] = 'so.object_id';
|
||||||
|
$group[] = 's.service_id';
|
||||||
|
break;
|
||||||
|
case 'servicestatus':
|
||||||
|
$group[] = 'ss.servicestatus_id';
|
||||||
|
break;
|
||||||
|
case 'timeperiods':
|
||||||
|
$group[] = 'ht.timeperiod_id';
|
||||||
|
$group[] = 'st.timeperiod_id';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
continue 2;
|
||||||
|
}
|
||||||
|
$groupedTables[$tableName] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: What if $alias is neither a native nor a custom alias???
|
break;
|
||||||
$table = $this->aliasToTableName(
|
|
||||||
$this->hasAliasName($alias) ? $alias : $this->customAliasToAlias($alias)
|
|
||||||
);
|
|
||||||
|
|
||||||
// TODO: We cannot rely on the underlying select here, tables may be joined multiple times with
|
|
||||||
// different aliases so the only way to get the correct alias here is to register such by ourself
|
|
||||||
// for each virtual column (We may also inspect $column for the alias but this will probably lead
|
|
||||||
// to false positives.. AND prevents custom implementations from providing their own "mapping")
|
|
||||||
if (($tableAlias = $this->getJoinedTableAlias($this->prefix . $table)) === null) {
|
|
||||||
$tableAlias = $table;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: Same issue as with identifying table aliases; Our virtual tables are not named exactly how
|
|
||||||
// they are in the IDO. We definitely need to register aliases explicitly (hint: DbRepository
|
|
||||||
// is already providing such..)
|
|
||||||
$aliasedPk = $tableAlias . '.' . $this->getPrimaryKeyColumn($table);
|
|
||||||
if (! in_array($aliasedPk, $group)) {
|
|
||||||
$group[] = $aliasedPk;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $group;
|
return array_unique($group);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Move this away, see note related to $idoVersion var
|
// TODO: Move this away, see note related to $idoVersion var
|
||||||
|
|
|
@ -13,13 +13,20 @@ class ServicecommentQuery extends IdoQuery
|
||||||
*/
|
*/
|
||||||
protected $allowCustomVars = true;
|
protected $allowCustomVars = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupBase = array('comments' => array('c.comment_id', 'so.object_id'));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupOrigin = array('hostgroups', 'servicegroups');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
protected $columnMap = array(
|
protected $columnMap = array(
|
||||||
'instances' => array(
|
|
||||||
'instance_name' => 'i.instance_name'
|
|
||||||
),
|
|
||||||
'comments' => array(
|
'comments' => array(
|
||||||
'comment_author' => 'c.author_name COLLATE latin1_general_ci',
|
'comment_author' => 'c.author_name COLLATE latin1_general_ci',
|
||||||
'comment_author_name' => 'c.author_name',
|
'comment_author_name' => 'c.author_name',
|
||||||
|
@ -46,6 +53,9 @@ class ServicecommentQuery extends IdoQuery
|
||||||
'host_alias' => 'h.alias',
|
'host_alias' => 'h.alias',
|
||||||
'host_display_name' => 'h.display_name COLLATE latin1_general_ci'
|
'host_display_name' => 'h.display_name COLLATE latin1_general_ci'
|
||||||
),
|
),
|
||||||
|
'instances' => array(
|
||||||
|
'instance_name' => 'i.instance_name'
|
||||||
|
),
|
||||||
'hoststatus' => array(
|
'hoststatus' => array(
|
||||||
'host_state' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END'
|
'host_state' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END'
|
||||||
),
|
),
|
||||||
|
@ -144,6 +154,18 @@ class ServicecommentQuery extends IdoQuery
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Join instances
|
||||||
|
*/
|
||||||
|
protected function joinInstances()
|
||||||
|
{
|
||||||
|
$this->select->join(
|
||||||
|
array('i' => $this->prefix . 'instances'),
|
||||||
|
'i.instance_id = c.instance_id',
|
||||||
|
array()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Join services
|
* Join services
|
||||||
*/
|
*/
|
||||||
|
@ -167,48 +189,4 @@ class ServicecommentQuery extends IdoQuery
|
||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Join instances
|
|
||||||
*/
|
|
||||||
protected function joinInstances()
|
|
||||||
{
|
|
||||||
$this->select->join(
|
|
||||||
array('i' => $this->prefix . 'instances'),
|
|
||||||
'i.instance_id = c.instance_id',
|
|
||||||
array()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function getGroup()
|
|
||||||
{
|
|
||||||
$group = array();
|
|
||||||
if ($this->hasJoinedVirtualTable('hostgroups') || $this->hasJoinedVirtualTable('servicegroups')) {
|
|
||||||
$group = array('c.comment_id', 'so.object_id');
|
|
||||||
if ($this->hasJoinedVirtualTable('hosts')) {
|
|
||||||
$group[] = 'h.host_id';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->hasJoinedVirtualTable('services')) {
|
|
||||||
$group[] = 's.service_id';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->hasJoinedVirtualTable('hoststatus')) {
|
|
||||||
$group[] = 'hs.hoststatus_id';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->hasJoinedVirtualTable('servicestatus')) {
|
|
||||||
$group[] = 'ss.servicestatus_id';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->hasJoinedVirtualTable('instances')) {
|
|
||||||
$group[] = 'i.instance_id';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $group;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,15 +27,15 @@ class ServicecommentdeletionhistoryQuery extends ServicecommenthistoryQuery
|
||||||
{
|
{
|
||||||
parent::joinBaseTables();
|
parent::joinBaseTables();
|
||||||
$this->select->where("sch.deletion_time > '1970-01-02 00:00:00'");
|
$this->select->where("sch.deletion_time > '1970-01-02 00:00:00'");
|
||||||
$this->columnMap['history']['timestamp'] = str_replace(
|
$this->columnMap['commenthistory']['timestamp'] = str_replace(
|
||||||
'comment_time',
|
'comment_time',
|
||||||
'deletion_time',
|
'deletion_time',
|
||||||
$this->columnMap['history']['timestamp']
|
$this->columnMap['commenthistory']['timestamp']
|
||||||
);
|
);
|
||||||
$this->columnMap['history']['type'] = str_replace(
|
$this->columnMap['commenthistory']['type'] = str_replace(
|
||||||
'END)',
|
'END)',
|
||||||
"END || '_deleted')",
|
"END || '_deleted')",
|
||||||
$this->columnMap['history']['type']
|
$this->columnMap['commenthistory']['type']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,28 +13,33 @@ class ServicecommenthistoryQuery extends IdoQuery
|
||||||
*/
|
*/
|
||||||
protected $allowCustomVars = true;
|
protected $allowCustomVars = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupBase = array('commenthistory' => array('sch.commenthistory_id', 'so.object_id'));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupOrigin = array('hostgroups', 'services');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
protected $columnMap = array(
|
protected $columnMap = array(
|
||||||
'instances' => array(
|
|
||||||
'instance_name' => 'i.instance_name'
|
|
||||||
),
|
|
||||||
'commenthistory' => array(
|
'commenthistory' => array(
|
||||||
'host' => 'so.name1 COLLATE latin1_general_ci',
|
'host' => 'so.name1 COLLATE latin1_general_ci',
|
||||||
'host_name' => 'so.name1',
|
'host_name' => 'so.name1',
|
||||||
|
'object_id' => 'sch.object_id',
|
||||||
'object_type' => '(\'service\')',
|
'object_type' => '(\'service\')',
|
||||||
|
'output' => "('[' || sch.author_name || '] ' || sch.comment_data)",
|
||||||
'service' => 'so.name2 COLLATE latin1_general_ci',
|
'service' => 'so.name2 COLLATE latin1_general_ci',
|
||||||
'service_description' => 'so.name2',
|
'service_description' => 'so.name2',
|
||||||
'service_host' => 'so.name1 COLLATE latin1_general_ci',
|
'service_host' => 'so.name1 COLLATE latin1_general_ci',
|
||||||
'service_host_name' => 'so.name1'
|
'service_host_name' => 'so.name1',
|
||||||
),
|
'state' => '(-1)',
|
||||||
'history' => array(
|
'timestamp' => 'UNIX_TIMESTAMP(sch.comment_time)',
|
||||||
'type' => "(CASE sch.entry_type WHEN 1 THEN 'comment' WHEN 2 THEN 'dt_comment' WHEN 3 THEN 'flapping' WHEN 4 THEN 'ack' END)",
|
'type' => "(CASE sch.entry_type WHEN 1 THEN 'comment' WHEN 2 THEN 'dt_comment' WHEN 3 THEN 'flapping' WHEN 4 THEN 'ack' END)"
|
||||||
'timestamp' => 'UNIX_TIMESTAMP(sch.comment_time)',
|
|
||||||
'object_id' => 'sch.object_id',
|
|
||||||
'state' => '(-1)',
|
|
||||||
'output' => "('[' || sch.author_name || '] ' || sch.comment_data)",
|
|
||||||
),
|
),
|
||||||
'hostgroups' => array(
|
'hostgroups' => array(
|
||||||
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
|
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
|
||||||
|
@ -45,6 +50,9 @@ class ServicecommenthistoryQuery extends IdoQuery
|
||||||
'host_alias' => 'h.alias',
|
'host_alias' => 'h.alias',
|
||||||
'host_display_name' => 'h.display_name COLLATE latin1_general_ci'
|
'host_display_name' => 'h.display_name COLLATE latin1_general_ci'
|
||||||
),
|
),
|
||||||
|
'instances' => array(
|
||||||
|
'instance_name' => 'i.instance_name'
|
||||||
|
),
|
||||||
'servicegroups' => array(
|
'servicegroups' => array(
|
||||||
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
|
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
|
||||||
'servicegroup_name' => 'sgo.name1',
|
'servicegroup_name' => 'sgo.name1',
|
||||||
|
@ -81,7 +89,6 @@ class ServicecommenthistoryQuery extends IdoQuery
|
||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
$this->joinedVirtualTables['commenthistory'] = true;
|
$this->joinedVirtualTables['commenthistory'] = true;
|
||||||
$this->joinedVirtualTables['history'] = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -118,6 +125,18 @@ class ServicecommenthistoryQuery extends IdoQuery
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Join instances
|
||||||
|
*/
|
||||||
|
protected function joinInstances()
|
||||||
|
{
|
||||||
|
$this->select->join(
|
||||||
|
array('i' => $this->prefix . 'instances'),
|
||||||
|
'i.instance_id = sch.instance_id',
|
||||||
|
array()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Join service groups
|
* Join service groups
|
||||||
*/
|
*/
|
||||||
|
@ -149,33 +168,4 @@ class ServicecommenthistoryQuery extends IdoQuery
|
||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Join instances
|
|
||||||
*/
|
|
||||||
protected function joinInstances()
|
|
||||||
{
|
|
||||||
$this->select->join(
|
|
||||||
array('i' => $this->prefix . 'instances'),
|
|
||||||
'i.instance_id = sch.instance_id',
|
|
||||||
array()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function getGroup()
|
|
||||||
{
|
|
||||||
$group = array();
|
|
||||||
if ($this->hasJoinedVirtualTable('hostgroups') || $this->hasJoinedVirtualTable('servicegroups')) {
|
|
||||||
$group = array('sch.commenthistory_id', 'so.object_id');
|
|
||||||
if ($this->hasJoinedVirtualTable('services')) {
|
|
||||||
$group[] = 'h.host_id';
|
|
||||||
$group[] = 's.service_id';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $group;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,13 +13,20 @@ class ServicedowntimeQuery extends IdoQuery
|
||||||
*/
|
*/
|
||||||
protected $allowCustomVars = true;
|
protected $allowCustomVars = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupBase = array('downtimes' => array('sd.scheduleddowntime_id', 'so.object_id'));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupOrigin = array('hostgroups', 'servicegroups');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
protected $columnMap = array(
|
protected $columnMap = array(
|
||||||
'instances' => array(
|
|
||||||
'instance_name' => 'i.instance_name'
|
|
||||||
),
|
|
||||||
'downtimes' => array(
|
'downtimes' => array(
|
||||||
'downtime_author' => 'sd.author_name COLLATE latin1_general_ci',
|
'downtime_author' => 'sd.author_name COLLATE latin1_general_ci',
|
||||||
'downtime_author_name' => 'sd.author_name',
|
'downtime_author_name' => 'sd.author_name',
|
||||||
|
@ -55,6 +62,9 @@ class ServicedowntimeQuery extends IdoQuery
|
||||||
'hoststatus' => array(
|
'hoststatus' => array(
|
||||||
'host_state' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END'
|
'host_state' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END'
|
||||||
),
|
),
|
||||||
|
'instances' => array(
|
||||||
|
'instance_name' => 'i.instance_name'
|
||||||
|
),
|
||||||
'servicegroups' => array(
|
'servicegroups' => array(
|
||||||
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
|
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
|
||||||
'servicegroup_name' => 'sgo.name1',
|
'servicegroup_name' => 'sgo.name1',
|
||||||
|
@ -130,6 +140,18 @@ class ServicedowntimeQuery extends IdoQuery
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Join instances
|
||||||
|
*/
|
||||||
|
protected function joinInstances()
|
||||||
|
{
|
||||||
|
$this->select->join(
|
||||||
|
array('i' => $this->prefix . 'instances'),
|
||||||
|
'i.instance_id = sd.instance_id',
|
||||||
|
array()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Join service groups
|
* Join service groups
|
||||||
*/
|
*/
|
||||||
|
@ -173,49 +195,4 @@ class ServicedowntimeQuery extends IdoQuery
|
||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Join instances
|
|
||||||
*/
|
|
||||||
protected function joinInstances()
|
|
||||||
{
|
|
||||||
$this->select->join(
|
|
||||||
array('i' => $this->prefix . 'instances'),
|
|
||||||
'i.instance_id = sd.instance_id',
|
|
||||||
array()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function getGroup()
|
|
||||||
{
|
|
||||||
$group = array();
|
|
||||||
if ($this->hasJoinedVirtualTable('hostgroups') || $this->hasJoinedVirtualTable('servicegroups')) {
|
|
||||||
$group = array('sd.scheduleddowntime_id', 'so.object_id');
|
|
||||||
|
|
||||||
if ($this->hasJoinedVirtualTable('hosts')) {
|
|
||||||
$group[] = 'h.host_id';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->hasJoinedVirtualTable('hoststatus')) {
|
|
||||||
$group[] = 'hs.hoststatus_id';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->hasJoinedVirtualTable('services')) {
|
|
||||||
$group[] = 's.service_id';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->hasJoinedVirtualTable('servicestatus')) {
|
|
||||||
$group[] = 'ss.servicestatus_id';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->hasJoinedVirtualTable('instances')) {
|
|
||||||
$group[] = 'i.instance_id';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $group;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,11 +29,11 @@ class ServicedowntimeendhistoryQuery extends ServicedowntimestarthistoryQuery
|
||||||
{
|
{
|
||||||
parent::joinBaseTables(true);
|
parent::joinBaseTables(true);
|
||||||
$this->select->where("sdh.actual_end_time > '1970-01-02 00:00:00'");
|
$this->select->where("sdh.actual_end_time > '1970-01-02 00:00:00'");
|
||||||
$this->columnMap['history']['type'] = "('dt_end')";
|
$this->columnMap['downtimehistory']['type'] = "('dt_end')";
|
||||||
$this->columnMap['history']['timestamp'] = str_replace(
|
$this->columnMap['downtimehistory']['timestamp'] = str_replace(
|
||||||
'actual_start_time',
|
'actual_start_time',
|
||||||
'actual_end_time',
|
'actual_end_time',
|
||||||
$this->columnMap['history']['timestamp']
|
$this->columnMap['downtimehistory']['timestamp']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,28 +13,33 @@ class ServicedowntimestarthistoryQuery extends IdoQuery
|
||||||
*/
|
*/
|
||||||
protected $allowCustomVars = true;
|
protected $allowCustomVars = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupBase = array('downtimehistory' => array('sdh.downtimehistory_id', 'so.object_id'));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupOrigin = array('hostgroups', 'servicegroups');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
protected $columnMap = array(
|
protected $columnMap = array(
|
||||||
'instances' => array(
|
|
||||||
'instance_name' => 'i.instance_name'
|
|
||||||
),
|
|
||||||
'downtimehistory' => array(
|
'downtimehistory' => array(
|
||||||
'host' => 'so.name1 COLLATE latin1_general_ci',
|
'host' => 'so.name1 COLLATE latin1_general_ci',
|
||||||
'host_name' => 'so.name1',
|
'host_name' => 'so.name1',
|
||||||
|
'object_id' => 'sdh.object_id',
|
||||||
'object_type' => '(\'service\')',
|
'object_type' => '(\'service\')',
|
||||||
|
'output' => "('[' || sdh.author_name || '] ' || sdh.comment_data)",
|
||||||
'service' => 'so.name2 COLLATE latin1_general_ci',
|
'service' => 'so.name2 COLLATE latin1_general_ci',
|
||||||
'service_description' => 'so.name2',
|
'service_description' => 'so.name2',
|
||||||
'service_host' => 'so.name1 COLLATE latin1_general_ci',
|
'service_host' => 'so.name1 COLLATE latin1_general_ci',
|
||||||
'service_host_name' => 'so.name1'
|
'service_host_name' => 'so.name1',
|
||||||
),
|
'state' => '(-1)',
|
||||||
'history' => array(
|
'timestamp' => 'UNIX_TIMESTAMP(sdh.actual_start_time)',
|
||||||
'type' => "('dt_start')",
|
'type' => "('dt_start')"
|
||||||
'timestamp' => 'UNIX_TIMESTAMP(sdh.actual_start_time)',
|
|
||||||
'object_id' => 'sdh.object_id',
|
|
||||||
'state' => '(-1)',
|
|
||||||
'output' => "('[' || sdh.author_name || '] ' || sdh.comment_data)",
|
|
||||||
),
|
),
|
||||||
'hostgroups' => array(
|
'hostgroups' => array(
|
||||||
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
|
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
|
||||||
|
@ -45,6 +50,9 @@ class ServicedowntimestarthistoryQuery extends IdoQuery
|
||||||
'host_alias' => 'h.alias',
|
'host_alias' => 'h.alias',
|
||||||
'host_display_name' => 'h.display_name COLLATE latin1_general_ci'
|
'host_display_name' => 'h.display_name COLLATE latin1_general_ci'
|
||||||
),
|
),
|
||||||
|
'instances' => array(
|
||||||
|
'instance_name' => 'i.instance_name'
|
||||||
|
),
|
||||||
'servicegroups' => array(
|
'servicegroups' => array(
|
||||||
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
|
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
|
||||||
'servicegroup_name' => 'sgo.name1',
|
'servicegroup_name' => 'sgo.name1',
|
||||||
|
@ -90,7 +98,6 @@ class ServicedowntimestarthistoryQuery extends IdoQuery
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->joinedVirtualTables['downtimehistory'] = true;
|
$this->joinedVirtualTables['downtimehistory'] = true;
|
||||||
$this->joinedVirtualTables['history'] = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -127,6 +134,18 @@ class ServicedowntimestarthistoryQuery extends IdoQuery
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Join instances
|
||||||
|
*/
|
||||||
|
protected function joinInstances()
|
||||||
|
{
|
||||||
|
$this->select->join(
|
||||||
|
array('i' => $this->prefix . 'instances'),
|
||||||
|
'i.instance_id = sdh.instance_id',
|
||||||
|
array()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Join service groups
|
* Join service groups
|
||||||
*/
|
*/
|
||||||
|
@ -158,33 +177,4 @@ class ServicedowntimestarthistoryQuery extends IdoQuery
|
||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Join instances
|
|
||||||
*/
|
|
||||||
protected function joinInstances()
|
|
||||||
{
|
|
||||||
$this->select->join(
|
|
||||||
array('i' => $this->prefix . 'instances'),
|
|
||||||
'i.instance_id = sdh.instance_id',
|
|
||||||
array()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function getGroup()
|
|
||||||
{
|
|
||||||
$group = array();
|
|
||||||
if ($this->hasJoinedVirtualTable('hostgroups') || $this->hasJoinedVirtualTable('servicegroups')) {
|
|
||||||
$group = array('sdh.downtimehistory_id', 'so.object_id');
|
|
||||||
if ($this->hasJoinedVirtualTable('services')) {
|
|
||||||
$group[] = 'h.host_id';
|
|
||||||
$group[] = 's.service_id';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $group;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,13 +10,20 @@ class ServicegroupQuery extends IdoQuery
|
||||||
*/
|
*/
|
||||||
protected $allowCustomVars = true;
|
protected $allowCustomVars = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupBase = array('servicegroups' => array('sg.servicegroup_id', 'sgo.object_id'));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupOrigin = array('serviceobjects');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
protected $columnMap = array(
|
protected $columnMap = array(
|
||||||
'instances' => array(
|
|
||||||
'instance_name' => 'i.instance_name'
|
|
||||||
),
|
|
||||||
'hostgroups' => array(
|
'hostgroups' => array(
|
||||||
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
|
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
|
||||||
'hostgroup_alias' => 'hg.alias COLLATE latin1_general_ci',
|
'hostgroup_alias' => 'hg.alias COLLATE latin1_general_ci',
|
||||||
|
@ -26,6 +33,9 @@ class ServicegroupQuery extends IdoQuery
|
||||||
'host_alias' => 'h.alias',
|
'host_alias' => 'h.alias',
|
||||||
'host_display_name' => 'h.display_name COLLATE latin1_general_ci',
|
'host_display_name' => 'h.display_name COLLATE latin1_general_ci',
|
||||||
),
|
),
|
||||||
|
'instances' => array(
|
||||||
|
'instance_name' => 'i.instance_name'
|
||||||
|
),
|
||||||
'servicegroups' => array(
|
'servicegroups' => array(
|
||||||
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
|
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
|
||||||
'servicegroup_alias' => 'sg.alias COLLATE latin1_general_ci',
|
'servicegroup_alias' => 'sg.alias COLLATE latin1_general_ci',
|
||||||
|
@ -92,6 +102,18 @@ class ServicegroupQuery extends IdoQuery
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Join instances
|
||||||
|
*/
|
||||||
|
protected function joinInstances()
|
||||||
|
{
|
||||||
|
$this->select->join(
|
||||||
|
array('i' => $this->prefix . 'instances'),
|
||||||
|
'i.instance_id = sg.instance_id',
|
||||||
|
array()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Join service objects
|
* Join service objects
|
||||||
*/
|
*/
|
||||||
|
@ -120,29 +142,4 @@ class ServicegroupQuery extends IdoQuery
|
||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Join instances
|
|
||||||
*/
|
|
||||||
protected function joinInstances()
|
|
||||||
{
|
|
||||||
$this->select->join(
|
|
||||||
array('i' => $this->prefix . 'instances'),
|
|
||||||
'i.instance_id = sg.instance_id',
|
|
||||||
array()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function getGroup()
|
|
||||||
{
|
|
||||||
$group = array();
|
|
||||||
if ($this->hasJoinedVirtualTable('serviceobjects')) {
|
|
||||||
$group = array('sg.servicegroup_id', 'sgo.object_id');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $group;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,16 @@ class ServicestatehistoryQuery extends IdoQuery
|
||||||
*/
|
*/
|
||||||
protected $allowCustomVars = true;
|
protected $allowCustomVars = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupBase = array('statehistory' => array('sh.statehistory_id', 'so.object_id'));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupOrigin = array('hostgroups', 'servicegroups');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Array to map type names to type ids for query optimization
|
* Array to map type names to type ids for query optimization
|
||||||
*
|
*
|
||||||
|
@ -27,25 +37,6 @@ class ServicestatehistoryQuery extends IdoQuery
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
protected $columnMap = array(
|
protected $columnMap = array(
|
||||||
'instances' => array(
|
|
||||||
'instance_name' => 'i.instance_name'
|
|
||||||
),
|
|
||||||
'statehistory' => array(
|
|
||||||
'host' => 'so.name1 COLLATE latin1_general_ci',
|
|
||||||
'host_name' => 'so.name1',
|
|
||||||
'object_type' => '(\'service\')',
|
|
||||||
'service' => 'so.name2 COLLATE latin1_general_ci',
|
|
||||||
'service_description' => 'so.name2',
|
|
||||||
'service_host' => 'so.name1 COLLATE latin1_general_ci',
|
|
||||||
'service_host_name' => 'so.name1'
|
|
||||||
),
|
|
||||||
'history' => array(
|
|
||||||
'type' => "(CASE WHEN sh.state_type = 1 THEN 'hard_state' ELSE 'soft_state' END)",
|
|
||||||
'timestamp' => 'UNIX_TIMESTAMP(sh.state_time)',
|
|
||||||
'object_id' => 'sh.object_id',
|
|
||||||
'state' => 'sh.state',
|
|
||||||
'output' => "('[ ' || sh.current_check_attempt || '/' || sh.max_check_attempts || ' ] ' || sh.output)",
|
|
||||||
),
|
|
||||||
'hostgroups' => array(
|
'hostgroups' => array(
|
||||||
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
|
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
|
||||||
'hostgroup_alias' => 'hg.alias COLLATE latin1_general_ci',
|
'hostgroup_alias' => 'hg.alias COLLATE latin1_general_ci',
|
||||||
|
@ -55,6 +46,9 @@ class ServicestatehistoryQuery extends IdoQuery
|
||||||
'host_alias' => 'h.alias',
|
'host_alias' => 'h.alias',
|
||||||
'host_display_name' => 'h.display_name COLLATE latin1_general_ci'
|
'host_display_name' => 'h.display_name COLLATE latin1_general_ci'
|
||||||
),
|
),
|
||||||
|
'instances' => array(
|
||||||
|
'instance_name' => 'i.instance_name'
|
||||||
|
),
|
||||||
'servicegroups' => array(
|
'servicegroups' => array(
|
||||||
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
|
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
|
||||||
'servicegroup_name' => 'sgo.name1',
|
'servicegroup_name' => 'sgo.name1',
|
||||||
|
@ -62,7 +56,21 @@ class ServicestatehistoryQuery extends IdoQuery
|
||||||
),
|
),
|
||||||
'services' => array(
|
'services' => array(
|
||||||
'service_display_name' => 's.display_name COLLATE latin1_general_ci'
|
'service_display_name' => 's.display_name COLLATE latin1_general_ci'
|
||||||
)
|
),
|
||||||
|
'statehistory' => array(
|
||||||
|
'host' => 'so.name1 COLLATE latin1_general_ci',
|
||||||
|
'host_name' => 'so.name1',
|
||||||
|
'object_id' => 'sh.object_id',
|
||||||
|
'object_type' => '(\'service\')',
|
||||||
|
'output' => "('[ ' || sh.current_check_attempt || '/' || sh.max_check_attempts || ' ] ' || sh.output)",
|
||||||
|
'service' => 'so.name2 COLLATE latin1_general_ci',
|
||||||
|
'service_description' => 'so.name2',
|
||||||
|
'service_host' => 'so.name1 COLLATE latin1_general_ci',
|
||||||
|
'service_host_name' => 'so.name1',
|
||||||
|
'state' => 'sh.state',
|
||||||
|
'timestamp' => 'UNIX_TIMESTAMP(sh.state_time)',
|
||||||
|
'type' => "(CASE WHEN sh.state_type = 1 THEN 'hard_state' ELSE 'soft_state' END)"
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -73,7 +81,7 @@ class ServicestatehistoryQuery extends IdoQuery
|
||||||
if ($col === 'UNIX_TIMESTAMP(sh.state_time)') {
|
if ($col === 'UNIX_TIMESTAMP(sh.state_time)') {
|
||||||
return 'sh.state_time ' . $sign . ' ' . $this->timestampForSql($this->valueToTimestamp($expression));
|
return 'sh.state_time ' . $sign . ' ' . $this->timestampForSql($this->valueToTimestamp($expression));
|
||||||
} elseif (
|
} elseif (
|
||||||
$col === $this->columnMap['history']['type']
|
$col === $this->columnMap['statehistory']['type']
|
||||||
&& ! is_array($expression)
|
&& ! is_array($expression)
|
||||||
&& array_key_exists($expression, $this->types)
|
&& array_key_exists($expression, $this->types)
|
||||||
) {
|
) {
|
||||||
|
@ -97,7 +105,6 @@ class ServicestatehistoryQuery extends IdoQuery
|
||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
$this->joinedVirtualTables['statehistory'] = true;
|
$this->joinedVirtualTables['statehistory'] = true;
|
||||||
$this->joinedVirtualTables['history'] = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -134,6 +141,18 @@ class ServicestatehistoryQuery extends IdoQuery
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Join instances
|
||||||
|
*/
|
||||||
|
protected function joinInstances()
|
||||||
|
{
|
||||||
|
$this->select->join(
|
||||||
|
array('i' => $this->prefix . 'instances'),
|
||||||
|
'i.instance_id = sh.instance_id',
|
||||||
|
array()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Join service groups
|
* Join service groups
|
||||||
*/
|
*/
|
||||||
|
@ -165,33 +184,4 @@ class ServicestatehistoryQuery extends IdoQuery
|
||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Join instances
|
|
||||||
*/
|
|
||||||
protected function joinInstances()
|
|
||||||
{
|
|
||||||
$this->select->join(
|
|
||||||
array('i' => $this->prefix . 'instances'),
|
|
||||||
'i.instance_id = sh.instance_id',
|
|
||||||
array()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function getGroup()
|
|
||||||
{
|
|
||||||
$group = array();
|
|
||||||
if ($this->hasJoinedVirtualTable('hostgroups') || $this->hasJoinedVirtualTable('servicegroups')) {
|
|
||||||
$group = array('sh.statehistory_id', 'so.object_id');
|
|
||||||
if ($this->hasJoinedVirtualTable('services')) {
|
|
||||||
$group[] = 'h.host_id';
|
|
||||||
$group[] = 's.service_id';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $group;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
|
|
||||||
namespace Icinga\Module\Monitoring\Backend\Ido\Query;
|
namespace Icinga\Module\Monitoring\Backend\Ido\Query;
|
||||||
|
|
||||||
use Zend_Db_Expr;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Query for service status
|
* Query for service status
|
||||||
*/
|
*/
|
||||||
|
@ -15,10 +13,23 @@ class ServicestatusQuery extends IdoQuery
|
||||||
*/
|
*/
|
||||||
protected $allowCustomVars = true;
|
protected $allowCustomVars = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupBase = array('services' => array('so.object_id', 's.service_id'));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupOrigin = array('hostgroups', 'servicegroups');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
protected $columnMap = array(
|
protected $columnMap = array(
|
||||||
|
'checktimeperiods' => array(
|
||||||
|
'service_check_timeperiod' => 'ctp.alias COLLATE latin1_general_ci'
|
||||||
|
),
|
||||||
'hostgroups' => array(
|
'hostgroups' => array(
|
||||||
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
|
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
|
||||||
'hostgroup_alias' => 'hg.alias COLLATE latin1_general_ci',
|
'hostgroup_alias' => 'hg.alias COLLATE latin1_general_ci',
|
||||||
|
@ -270,9 +281,6 @@ class ServicestatusQuery extends IdoQuery
|
||||||
'service_state_type' => 'ss.state_type',
|
'service_state_type' => 'ss.state_type',
|
||||||
'service_status_update_time' => 'ss.status_update_time',
|
'service_status_update_time' => 'ss.status_update_time',
|
||||||
'service_unhandled' => 'CASE WHEN (ss.problem_has_been_acknowledged + ss.scheduled_downtime_depth + COALESCE(hs.current_state, 0)) = 0 THEN 1 ELSE 0 END'
|
'service_unhandled' => 'CASE WHEN (ss.problem_has_been_acknowledged + ss.scheduled_downtime_depth + COALESCE(hs.current_state, 0)) = 0 THEN 1 ELSE 0 END'
|
||||||
),
|
|
||||||
'checktimeperiods' => array(
|
|
||||||
'service_check_timeperiod' => 'ctp.alias COLLATE latin1_general_ci'
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -301,6 +309,18 @@ class ServicestatusQuery extends IdoQuery
|
||||||
$this->joinedVirtualTables['services'] = true;
|
$this->joinedVirtualTables['services'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Join check time periods
|
||||||
|
*/
|
||||||
|
protected function joinChecktimeperiods()
|
||||||
|
{
|
||||||
|
$this->select->joinLeft(
|
||||||
|
array('ctp' => $this->prefix . 'timeperiods'),
|
||||||
|
'ctp.timeperiod_object_id = s.check_timeperiod_object_id',
|
||||||
|
array()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Join host groups
|
* Join host groups
|
||||||
*/
|
*/
|
||||||
|
@ -390,81 +410,25 @@ class ServicestatusQuery extends IdoQuery
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function joinChecktimeperiods()
|
|
||||||
{
|
|
||||||
$this->select->joinLeft(
|
|
||||||
array('ctp' => $this->prefix . 'timeperiods'),
|
|
||||||
'ctp.timeperiod_object_id = s.check_timeperiod_object_id',
|
|
||||||
array()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function getGroup()
|
protected function handleGroupColumn($column, &$groupColumns, &$groupedTables)
|
||||||
{
|
{
|
||||||
$group = parent::getGroup() ?: array();
|
switch ($column) {
|
||||||
if (! is_array($group)) {
|
case 'service_handled':
|
||||||
$group = array($group);
|
case 'service_severity':
|
||||||
}
|
case 'service_unhandled':
|
||||||
$groupedTables = array();
|
if (! isset($groupedTables['hoststatus'])) {
|
||||||
if ($this->hasJoinedVirtualTable('servicegroups')) {
|
$groupColumns[] = 'hs.hoststatus_id';
|
||||||
$group[] = 'so.object_id';
|
$groupedTables['hoststatus'] = true;
|
||||||
$group[] = 's.service_id';
|
|
||||||
$groupedTables['services'] = true;
|
|
||||||
$serviceGroupColumns = array_keys($this->columnMap['servicegroups']);
|
|
||||||
$selectedServiceGroupColumns = array_intersect($serviceGroupColumns, array_keys($this->columns));
|
|
||||||
if (! empty($selectedServiceGroupColumns)) {
|
|
||||||
$group[] = 'sgo.object_id';
|
|
||||||
$group[] = 'sg.servicegroup_id';
|
|
||||||
$groupedTables['servicegroups'] = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($this->hasJoinedVirtualTable('hostgroups')) {
|
|
||||||
if (! isset($groupedTables['services'])) {
|
|
||||||
$group[] = 'so.object_id';
|
|
||||||
$group[] = 's.service_id';
|
|
||||||
$groupedTables['services'] = true;
|
|
||||||
}
|
|
||||||
$hostGroupColumns = array_keys($this->columnMap['hostgroups']);
|
|
||||||
$selectedHostGroupColumns = array_intersect($hostGroupColumns, array_keys($this->columns));
|
|
||||||
if (! empty($selectedHostGroupColumns)) {
|
|
||||||
$group[] = 'hgo.object_id';
|
|
||||||
$group[] = 'hg.hostgroup_id';
|
|
||||||
$groupedTables['hostgroups'] = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (! empty($groupedTables)) {
|
|
||||||
foreach ($this->columns as $alias => $column) {
|
|
||||||
if ($column instanceof Zend_Db_Expr || $column === '(NULL)') {
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
$tableName = $this->aliasToTableName(
|
if (! isset($groupedTables['servicestatus'])) {
|
||||||
$this->hasAliasName($alias) ? $alias : $this->customAliasToAlias($alias)
|
$groupColumns[] = 'ss.servicestatus_id';
|
||||||
);
|
$groupedTables['servicestatus'] = true;
|
||||||
if (isset($groupedTables[$tableName])) {
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
switch ($tableName) {
|
return true;
|
||||||
case 'hosts':
|
|
||||||
$group[] = 'h.host_id';
|
|
||||||
break;
|
|
||||||
case 'hoststatus':
|
|
||||||
$group[] = 'hs.hoststatus_id';
|
|
||||||
break;
|
|
||||||
case 'instances':
|
|
||||||
$group[] = 'i.instance_id';
|
|
||||||
break;
|
|
||||||
case 'servicestatus':
|
|
||||||
$group[] = 'ss.servicestatus_id';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
continue 2;
|
|
||||||
}
|
|
||||||
$groupedTables[$tableName] = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return $group;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
<?php
|
||||||
|
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
|
||||||
|
|
||||||
|
namespace Icinga\Module\Monitoring\Data;
|
||||||
|
|
||||||
|
use ArrayIterator;
|
||||||
|
use FilterIterator;
|
||||||
|
use Zend_Db_Expr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Iterator over non-pseudo monitoring query columns
|
||||||
|
*/
|
||||||
|
class ColumnFilterIterator extends FilterIterator
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Create a new ColumnFilterIterator
|
||||||
|
*
|
||||||
|
* @param array $columns
|
||||||
|
*/
|
||||||
|
public function __construct(array $columns)
|
||||||
|
{
|
||||||
|
parent::__construct(new ArrayIterator($columns));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function accept()
|
||||||
|
{
|
||||||
|
$column = $this->current();
|
||||||
|
return ! ($column instanceof Zend_Db_Expr || $column === '(NULL)');
|
||||||
|
}
|
||||||
|
}
|
|
@ -14,7 +14,6 @@ class Comment extends DataView
|
||||||
public function getColumns()
|
public function getColumns()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'instance_name',
|
|
||||||
'comment_author_name',
|
'comment_author_name',
|
||||||
'comment_data',
|
'comment_data',
|
||||||
'comment_expiration',
|
'comment_expiration',
|
||||||
|
@ -40,6 +39,7 @@ class Comment extends DataView
|
||||||
'comment_author',
|
'comment_author',
|
||||||
'host', 'host_alias',
|
'host', 'host_alias',
|
||||||
'hostgroup', 'hostgroup_alias', 'hostgroup_name',
|
'hostgroup', 'hostgroup_alias', 'hostgroup_name',
|
||||||
|
'instance_name',
|
||||||
'service',
|
'service',
|
||||||
'servicegroup', 'servicegroup_alias', 'servicegroup_name'
|
'servicegroup', 'servicegroup_alias', 'servicegroup_name'
|
||||||
);
|
);
|
||||||
|
|
|
@ -14,7 +14,6 @@ class Downtime extends DataView
|
||||||
public function getColumns()
|
public function getColumns()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'instance_name',
|
|
||||||
'downtime_author_name',
|
'downtime_author_name',
|
||||||
'downtime_comment',
|
'downtime_comment',
|
||||||
'downtime_duration',
|
'downtime_duration',
|
||||||
|
@ -47,6 +46,7 @@ class Downtime extends DataView
|
||||||
'downtime_author',
|
'downtime_author',
|
||||||
'host', 'host_alias',
|
'host', 'host_alias',
|
||||||
'hostgroup', 'hostgroup_alias', 'hostgroup_name',
|
'hostgroup', 'hostgroup_alias', 'hostgroup_name',
|
||||||
|
'instance_name',
|
||||||
'service',
|
'service',
|
||||||
'servicegroup', 'servicegroup_alias', 'servicegroup_name'
|
'servicegroup', 'servicegroup_alias', 'servicegroup_name'
|
||||||
);
|
);
|
||||||
|
|
|
@ -36,6 +36,7 @@ class Hostcomment extends DataView
|
||||||
return array(
|
return array(
|
||||||
'host', 'host_alias',
|
'host', 'host_alias',
|
||||||
'hostgroup', 'hostgroup_alias', 'hostgroup_name',
|
'hostgroup', 'hostgroup_alias', 'hostgroup_name',
|
||||||
|
'instance_name',
|
||||||
'service', 'service_description', 'service_display_name',
|
'service', 'service_description', 'service_display_name',
|
||||||
'servicegroup', 'servicegroup_alias', 'servicegroup_name'
|
'servicegroup', 'servicegroup_alias', 'servicegroup_name'
|
||||||
);
|
);
|
||||||
|
|
|
@ -41,6 +41,7 @@ class Hostdowntime extends DataView
|
||||||
return array(
|
return array(
|
||||||
'host', 'host_alias',
|
'host', 'host_alias',
|
||||||
'hostgroup', 'hostgroup_alias', 'hostgroup_name',
|
'hostgroup', 'hostgroup_alias', 'hostgroup_name',
|
||||||
|
'instance_name',
|
||||||
'service', 'service_description', 'service_display_name',
|
'service', 'service_description', 'service_display_name',
|
||||||
'servicegroup', 'servicegroup_alias', 'servicegroup_name'
|
'servicegroup', 'servicegroup_alias', 'servicegroup_name'
|
||||||
);
|
);
|
||||||
|
|
|
@ -39,6 +39,7 @@ class Servicecomment extends DataView
|
||||||
return array(
|
return array(
|
||||||
'host', 'host_alias',
|
'host', 'host_alias',
|
||||||
'hostgroup', 'hostgroup_alias', 'hostgroup_name',
|
'hostgroup', 'hostgroup_alias', 'hostgroup_name',
|
||||||
|
'instance_name',
|
||||||
'service',
|
'service',
|
||||||
'servicegroup', 'servicegroup_alias', 'servicegroup_name'
|
'servicegroup', 'servicegroup_alias', 'servicegroup_name'
|
||||||
);
|
);
|
||||||
|
|
|
@ -41,6 +41,7 @@ class Servicedowntime extends DataView
|
||||||
return array(
|
return array(
|
||||||
'host', 'host_alias',
|
'host', 'host_alias',
|
||||||
'hostgroup', 'hostgroup_alias', 'hostgroup_name',
|
'hostgroup', 'hostgroup_alias', 'hostgroup_name',
|
||||||
|
'instance_name',
|
||||||
'service',
|
'service',
|
||||||
'servicegroup', 'servicegroup_alias', 'servicegroup_name'
|
'servicegroup', 'servicegroup_alias', 'servicegroup_name'
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue