diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ProgramstatusQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ProgramstatusQuery.php index f84b41ca5..95822ce7c 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ProgramstatusQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ProgramstatusQuery.php @@ -4,10 +4,13 @@ namespace Icinga\Module\Monitoring\Backend\Ido\Query; /** - * Query program status out of database + * Program status query */ class ProgramstatusQuery extends IdoQuery { + /** + * {@inheritdoc} + */ protected $columnMap = array( 'programstatus' => array( 'id' => 'programstatus_id', @@ -15,16 +18,11 @@ class ProgramstatusQuery extends IdoQuery 'program_version' => 'program_version', 'program_start_time' => 'UNIX_TIMESTAMP(programstatus.program_start_time)', 'program_end_time' => 'UNIX_TIMESTAMP(programstatus.program_end_time)', - 'is_currently_running' => 'CASE WHEN (programstatus.is_currently_running = 0) + 'is_currently_running' => 'CASE WHEN (UNIX_TIMESTAMP(programstatus.status_update_time) + 60 > UNIX_TIMESTAMP(NOW())) THEN - 0 + 1 ELSE - CASE WHEN (UNIX_TIMESTAMP(programstatus.status_update_time) + 60 > UNIX_TIMESTAMP(NOW())) - THEN - 1 - ELSE - 0 - END + 0 END', 'process_id' => 'process_id', 'endpoint_name' => 'endpoint_name', @@ -50,6 +48,9 @@ class ProgramstatusQuery extends IdoQuery ) ); + /** + * {@inheritdoc} + */ protected function joinBaseTables() { parent::joinBaseTables();