monitoring: Support host and service filters for downtimes

refs #7278
This commit is contained in:
Eric Lippmann 2014-09-19 14:28:23 +02:00
parent bea110d0c7
commit 4b7096bbbf
2 changed files with 5 additions and 3 deletions

View File

@ -19,9 +19,9 @@ class CommentQuery extends IdoQuery
'comment_is_persistent' => 'cm.is_persistent',
'comment_expiration' => 'CASE cm.expires WHEN 1 THEN UNIX_TIMESTAMP(cm.expiration_time) ELSE NULL END',
'comment_host' => 'CASE WHEN ho.name1 IS NULL THEN so.name1 ELSE ho.name1 END COLLATE latin1_general_ci',
'host' => 'CASE WHEN ho.name1 IS NULL THEN so.name1 ELSE ho.name1 END COLLATE latin1_general_ci',
'host' => 'CASE WHEN ho.name1 IS NULL THEN so.name1 ELSE ho.name1 END COLLATE latin1_general_ci', // #7278, #7279
'comment_service' => 'so.name2 COLLATE latin1_general_ci',
'service' => 'so.name2 COLLATE latin1_general_ci',
'service' => 'so.name2 COLLATE latin1_general_ci', // #7278, #7279
'comment_objecttype' => "CASE WHEN ho.object_id IS NOT NULL THEN 'host' ELSE CASE WHEN so.object_id IS NOT NULL THEN 'service' ELSE NULL END END",
)
);

View File

@ -28,8 +28,10 @@ class DowntimeQuery extends IdoQuery
'downtime_duration' => 'sd.duration',
'downtime_is_in_effect' => 'sd.is_in_effect',
'downtime_internal_id' => 'sd.internal_downtime_id',
'downtime_host' => 'CASE WHEN ho.name1 IS NULL THEN so.name1 ELSE ho.name1 END COLLATE latin1_general_ci',
'downtime_host' => 'CASE WHEN ho.name1 IS NULL THEN so.name1 ELSE ho.name1 END COLLATE latin1_general_ci', // #7278, #7279
'host' => 'CASE WHEN ho.name1 IS NULL THEN so.name1 ELSE ho.name1 END COLLATE latin1_general_ci',
'downtime_service' => 'so.name2 COLLATE latin1_general_ci',
'service' => 'so.name2 COLLATE latin1_general_ci', // #7278, #7279
'downtime_objecttype' => "CASE WHEN ho.object_id IS NOT NULL THEN 'host' ELSE CASE WHEN so.object_id IS NOT NULL THEN 'service' ELSE NULL END END",
'downtime_host_state' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END',
'downtime_service_state' => 'CASE WHEN ss.has_been_checked = 0 OR ss.has_been_checked IS NULL THEN 99 ELSE ss.current_state END'