More cleanup, timestamp fixes

This commit is contained in:
Thomas Gelf 2013-08-21 00:01:37 +02:00 committed by Eric Lippmann
parent cd37f47d1b
commit 781fb394ac

View File

@ -33,22 +33,25 @@ class StatusQuery extends AbstractQuery
'host_accepts_passive_checks' => 'hs.passive_checks_enabled',
'host_last_state_change' => 'UNIX_TIMESTAMP(hs.last_state_change)',
'host_last_hard_state' => 'hs.last_hard_state',
'host_last_hard_state_change' => 'hs.last_hard_state_change',
'host_last_hard_state_change' => 'UNIX_TIMESTAMP(hs.last_hard_state_change)',
'host_check_command' => 'hs.check_command',
'host_last_check' => 'UNIX_TIMESTAMP(hs.last_check)',
'host_next_check' => 'CASE hs.should_be_scheduled WHEN 1 THEN UNIX_TIMESTAMP(hs.next_check) ELSE NULL END',
'host_check_execution_time' => 'hs.execution_time',
'host_check_latency' => 'hs.latency',
'host_problem' => 'CASE WHEN hs.current_state = 0 THEN 0 ELSE 1 END',
'host_notifications_enabled' => 'hs.notifications_enabled',
'host_last_time_up' => 'UNIX_TIMESTAMP(hs.last_time_up)',
'host_last_time_down' => 'UNIX_TIMESTAMP(hs.last_time_down)',
'host_last_time_unreachable' => 'UNIX_TIMESTAMP(hs.last_time_unreachable)',
'host_current_check_attempt' => 'hs.current_check_attempt',
'host_max_check_attempts' => 'hs.max_check_attempts',
'host_attempt' => 'hs.current_check_attempt || \'/\' || hs.max_check_attempts',
'host_check_type' => 'hs.check_type',
'host_last_time_up' => 'hs.last_time_up',
'host_last_time_down' => 'hs.last_time_down',
'host_last_time_unreachable' => 'hs.last_time_unreachable',
'host_state_type' => 'hs.state_type',
'host_last_notification' => 'hs.last_notification',
'host_next_notification' => 'hs.next_notification',
'host_no_more_notifications' => 'hs.no_more_notifications',
'host_notifications_enabled' => 'hs.notifications_enabled',
'host_problem_has_been_acknowledged' => 'hs.problem_has_been_acknowledged',
'host_acknowledgement_type' => 'hs.acknowledgement_type',
'host_current_notification_number' => 'hs.current_notification_number',
@ -58,8 +61,6 @@ class StatusQuery extends AbstractQuery
'host_flap_detection_enabled' => 'hs.flap_detection_enabled',
'host_is_flapping' => 'hs.is_flapping',
'host_percent_state_change' => 'hs.percent_state_change',
'host_check_latency' => 'hs.latency',
'host_check_execution_time' => 'hs.execution_time',
'host_scheduled_downtime_depth' => 'hs.scheduled_downtime_depth',
'host_failure_prediction_enabled' => 'hs.failure_prediction_enabled',
'host_process_performance_data' => 'hs.process_performance_data',
@ -71,7 +72,6 @@ class StatusQuery extends AbstractQuery
'host_retry_check_interval' => 'hs.retry_check_interval',
'host_check_timeperiod_object_id' => 'hs.check_timeperiod_object_id',
'host_status_update_time' => 'hs.status_update_time',
'host_problem' => 'CASE WHEN hs.current_state = 0 THEN 0 ELSE 1 END',
'host_severity' => 'CASE WHEN hs.current_state = 0
THEN
CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL