monitoring: Fix code style in the StatehistoryQuery

This commit is contained in:
Eric Lippmann 2015-01-21 10:12:14 +01:00
parent 10571c3178
commit 7d967d25b3

View File

@ -1,6 +1,4 @@
<?php <?php
// {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\Backend\Ido\Query; namespace Icinga\Module\Monitoring\Backend\Ido\Query;
@ -8,27 +6,27 @@ class StatehistoryQuery extends IdoQuery
{ {
protected $types = array( protected $types = array(
'soft_state' => 0, 'soft_state' => 0,
'hard_state' => 1, 'hard_state' => 1
); );
protected $columnMap = array( protected $columnMap = array(
'statehistory' => array( 'statehistory' => array(
'raw_timestamp' => 'sh.state_time', 'raw_timestamp' => 'sh.state_time',
'timestamp' => 'UNIX_TIMESTAMP(sh.state_time)', 'timestamp' => 'UNIX_TIMESTAMP(sh.state_time)',
'state_time' => 'sh.state_time', 'state_time' => 'sh.state_time',
'object_id' => 'sho.object_id', 'object_id' => 'sho.object_id',
'type' => "(CASE WHEN sh.state_type = 1 THEN 'hard_state' ELSE 'soft_state' END)", 'type' => "(CASE WHEN sh.state_type = 1 THEN 'hard_state' ELSE 'soft_state' END)",
'state' => 'sh.state', 'state' => 'sh.state',
'state_type' => 'sh.state_type', 'state_type' => 'sh.state_type',
'output' => 'sh.output', 'output' => 'sh.output',
'attempt' => 'sh.current_check_attempt', 'attempt' => 'sh.current_check_attempt',
'max_attempts' => 'sh.max_check_attempts', 'max_attempts' => 'sh.max_check_attempts',
'host' => 'sho.name1 COLLATE latin1_general_ci', 'host' => 'sho.name1 COLLATE latin1_general_ci',
'host_name' => 'sho.name1 COLLATE latin1_general_ci', 'host_name' => 'sho.name1 COLLATE latin1_general_ci',
'service' => 'sho.name2 COLLATE latin1_general_ci', 'service' => 'sho.name2 COLLATE latin1_general_ci',
'service_description' => 'sho.name2 COLLATE latin1_general_ci', 'service_description' => 'sho.name2 COLLATE latin1_general_ci',
'service_host_name' => 'sho.name1 COLLATE latin1_general_ci', 'service_host_name' => 'sho.name1 COLLATE latin1_general_ci',
'object_type' => "CASE WHEN sho.objecttype_id = 1 THEN 'host' ELSE 'service' END" 'object_type' => "CASE WHEN sho.objecttype_id = 1 THEN 'host' ELSE 'service' END"
) )
); );