From a8832517bf066cae062e26006e323f38d491b08d Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 16 Apr 2019 10:24:33 +0200 Subject: [PATCH] Ido\Query: Add missing `host` and `service` columns to history queries fixes #3721 --- .../Backend/Ido/Query/HostflappingstarthistoryQuery.php | 2 ++ .../Monitoring/Backend/Ido/Query/HostnotificationQuery.php | 2 ++ .../Backend/Ido/Query/ServiceflappingstarthistoryQuery.php | 2 ++ .../Monitoring/Backend/Ido/Query/ServicenotificationQuery.php | 2 ++ 4 files changed, 8 insertions(+) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostflappingstarthistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostflappingstarthistoryQuery.php index 47d626b90..b9d538234 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostflappingstarthistoryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostflappingstarthistoryQuery.php @@ -34,6 +34,7 @@ class HostflappingstarthistoryQuery extends IdoQuery protected $columnMap = array( 'flappinghistory' => array( 'id' => 'hfh.flappinghistory_id', + 'host' => 'ho.name1 COLLATE latin1_general_ci', 'host_name' => 'ho.name1', 'object_id' => 'hfh.object_id', 'object_type' => '(\'host\')', @@ -58,6 +59,7 @@ class HostflappingstarthistoryQuery extends IdoQuery 'servicegroup_alias' => 'sg.alias COLLATE latin1_general_ci' ), 'services' => array( + 'service' => 'so.name2 COLLATE latin1_general_ci', 'service_description' => 'so.name2', 'service_display_name' => 's.display_name COLLATE latin1_general_ci', 'service_host_name' => 'so.name1' diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostnotificationQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostnotificationQuery.php index 85beb1783..38ab9a557 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostnotificationQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostnotificationQuery.php @@ -42,6 +42,7 @@ class HostnotificationQuery extends IdoQuery 'instance_name' => 'i.instance_name' ), 'notifications' => array( + 'host' => 'ho.name1 COLLATE latin1_general_ci', 'host_name' => 'ho.name1', 'notification_output' => 'hn.output', 'notification_reason' => 'hn.notification_reason', @@ -53,6 +54,7 @@ class HostnotificationQuery extends IdoQuery 'servicegroup_name' => 'sgo.name1' ), 'services' => array( + 'service' => 'so.name2 COLLATE latin1_general_ci', 'service_description' => 'so.name2', 'service_display_name' => 's.display_name COLLATE latin1_general_ci', 'service_host_name' => 'so.name1' diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServiceflappingstarthistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServiceflappingstarthistoryQuery.php index b064c722b..b4fd78cb4 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServiceflappingstarthistoryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServiceflappingstarthistoryQuery.php @@ -34,10 +34,12 @@ class ServiceflappingstarthistoryQuery extends IdoQuery protected $columnMap = array( 'flappinghistory' => array( 'id' => 'sfh.flappinghistory_id', + 'host' => 'so.name1 COLLATE latin1_general_ci', 'host_name' => 'so.name1', 'object_id' => 'sfh.object_id', 'object_type' => '(\'service\')', 'output' => '(sfh.percent_state_change || \'\')', + 'service' => 'so.name2 COLLATE latin1_general_ci', 'service_description' => 'so.name2', 'service_host_name' => 'so.name1', 'state' => '(-1)', diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicenotificationQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicenotificationQuery.php index 22b127b9c..b98f5e1e7 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicenotificationQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicenotificationQuery.php @@ -42,12 +42,14 @@ class ServicenotificationQuery extends IdoQuery 'instance_name' => 'i.instance_name' ), 'notifications' => array( + 'host' => 'so.name1 COLLATE latin1_general_ci', 'host_name' => 'so.name1', 'notification_output' => 'sn.output', 'notification_reason' => 'sn.notification_reason', 'notification_state' => 'sn.state', 'notification_timestamp' => 'UNIX_TIMESTAMP(sn.start_time)', 'object_type' => '(\'service\')', + 'service' => 'so.name2 COLLATE latin1_general_ci', 'service_description' => 'so.name2', 'service_host_name' => 'so.name1' ),