diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeQuery.php index 1127a537c..420559ba8 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeQuery.php @@ -30,7 +30,8 @@ class DowntimeQuery extends IdoQuery 'downtime_scheduled_end' => 'd.downtime_scheduled_end', 'downtime_scheduled_start' => 'd.downtime_scheduled_start', 'downtime_start' => 'd.downtime_start', - 'object_type' => 'd.object_type' + 'object_type' => 'd.object_type', + 'instance_name' => 'd.instance_name' ), 'hosts' => array( 'host_display_name' => 'd.host_display_name', diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimeQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimeQuery.php index 2776bcdc2..a8ff8355b 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimeQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimeQuery.php @@ -17,6 +17,9 @@ class HostdowntimeQuery extends IdoQuery * {@inheritdoc} */ protected $columnMap = array( + 'instances' => array( + 'instance_name' => 'i.instance_name' + ), 'downtimes' => array( 'downtime_author' => 'sd.author_name COLLATE latin1_general_ci', 'downtime_author_name' => 'sd.author_name', @@ -157,6 +160,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() + ); + } + /** * {@inheritdoc} */ diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicedowntimeQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicedowntimeQuery.php index 09162ea35..18a22ea93 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicedowntimeQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicedowntimeQuery.php @@ -17,6 +17,9 @@ class ServicedowntimeQuery extends IdoQuery * {@inheritdoc} */ protected $columnMap = array( + 'instances' => array( + 'instance_name' => 'i.instance_name' + ), 'downtimes' => array( 'downtime_author' => 'sd.author_name COLLATE latin1_general_ci', 'downtime_author_name' => 'sd.author_name', @@ -171,6 +174,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() + ); + } + /** * {@inheritdoc} */ diff --git a/modules/monitoring/library/Monitoring/DataView/Downtime.php b/modules/monitoring/library/Monitoring/DataView/Downtime.php index 5787a09ff..57450c948 100644 --- a/modules/monitoring/library/Monitoring/DataView/Downtime.php +++ b/modules/monitoring/library/Monitoring/DataView/Downtime.php @@ -14,6 +14,7 @@ class Downtime extends DataView public function getColumns() { return array( + 'instance_name', 'downtime_author_name', 'downtime_comment', 'downtime_duration',