diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatehistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatehistoryQuery.php index e7ace1cb0..1fa2760d2 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatehistoryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatehistoryQuery.php @@ -65,7 +65,7 @@ class HoststatehistoryQuery extends IdoQuery 'host_name' => 'ho.name1', 'object_id' => 'hh.object_id', 'object_type' => '(\'host\')', - 'output' => "('[ ' || hh.current_check_attempt || '/' || hh.max_check_attempts || ' ] ' || hh.output)", + 'output' => '(CASE WHEN hh.state_type = 1 THEN hh.output ELSE \'[ \' || hh.current_check_attempt || \'/\' || hh.max_check_attempts || \' ] \' || hh.output END)', 'state' => 'hh.state', 'timestamp' => 'UNIX_TIMESTAMP(hh.state_time)', 'type' => "(CASE WHEN hh.state_type = 1 THEN 'hard_state' ELSE 'soft_state' END)" diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicestatehistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicestatehistoryQuery.php index 0fd18d9aa..e79db3e5e 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicestatehistoryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicestatehistoryQuery.php @@ -62,7 +62,7 @@ class ServicestatehistoryQuery extends IdoQuery 'host_name' => 'so.name1', 'object_id' => 'sh.object_id', 'object_type' => '(\'service\')', - 'output' => "('[ ' || sh.current_check_attempt || '/' || sh.max_check_attempts || ' ] ' || sh.output)", + 'output' => '(CASE WHEN sh.state_type = 1 THEN sh.output ELSE \'[ \' || sh.current_check_attempt || \'/\' || sh.max_check_attempts || \' ] \' || sh.output END)', 'service' => 'so.name2 COLLATE latin1_general_ci', 'service_description' => 'so.name2', 'service_host' => 'so.name1 COLLATE latin1_general_ci',