diff --git a/modules/monitoring/application/controllers/ShowController.php b/modules/monitoring/application/controllers/ShowController.php index e0d298fc8..6b2ff3d98 100644 --- a/modules/monitoring/application/controllers/ShowController.php +++ b/modules/monitoring/application/controllers/ShowController.php @@ -86,6 +86,7 @@ class Monitoring_ShowController extends ActionController public function serviceAction() { $this->view->object->prefetch(); + $this->view->object->eventHistory = $this->view->object->eventHistory->limit(10)->fetchAll(); $this->view->preserve = array(); } diff --git a/modules/monitoring/application/views/helpers/MonitoringProperties.php b/modules/monitoring/application/views/helpers/MonitoringProperties.php index 5c434240b..36f238c97 100644 --- a/modules/monitoring/application/views/helpers/MonitoringProperties.php +++ b/modules/monitoring/application/views/helpers/MonitoringProperties.php @@ -268,7 +268,7 @@ class Zend_View_Helper_MonitoringProperties extends Zend_View_Helper_Abstract return $out; } - public function getNotificationType(AbstractObject $notification) + public function getNotificationType($notification) { $reason = intval($notification->notification_reason); if (!isset(self::$notificationReasons[$reason])) { diff --git a/modules/monitoring/application/views/scripts/show/components/eventHistory.phtml b/modules/monitoring/application/views/scripts/show/components/eventHistory.phtml new file mode 100644 index 000000000..fd2eded86 --- /dev/null +++ b/modules/monitoring/application/views/scripts/show/components/eventHistory.phtml @@ -0,0 +1,89 @@ +eventHistory)): ?> +
= date('d.m. H:i', $event->timestamp); ?> | + ++ + + = $event->service_description ?> + + + + = $event->host_name ?> + + + | + ++ type) { + case 'notify': + $icon = '{{NOTIFICATION_ICON}}'; + $title = 'Notification'; + $msg = $event->output; + break; + case 'comment': + $icon = '{{COMMENT_ICON}}'; + $title = 'Comment'; + $msg = $event->output; + break; + case 'ack': + $icon = '{{ACKNOWLEDGEMENT_ICON}}'; + $title = 'Acknowledgement'; + $msg = ''; + break; + case 'dt_comment': + $icon = '{{IN_DOWNTIME_ICON}}'; + $title = 'In Downtime'; + $msg = $event->output; + break; + case 'flapping': + $icon = '{{FLAPPING_ICON}}'; + $title = 'Flapping'; + $msg = ''; + break; + case 'hard_state': + $icon = '{{HARDSTATE_ICON}}'; + $title = 'Hard State'; + $msg = '[' . $event->attempt . '/' . $event->max_attempts . ']'; + break; + case 'soft_state': + $icon = '{{SOFTSTATE_ICON}}'; + $title = 'Soft State'; + $msg = '[' . $event->attempt . '/' . $event->max_attempts . ']'; + break; + case 'dt_start': + $icon = '{{DOWNTIME_START_ICON}}'; + $title = 'Downtime Start'; + $msg = $event->output; + break; + case 'dt_end': + $icon = '{{DOWNTIME_END_ICON}}'; + $title = 'Downtime End'; + $msg = $event->output; + break; + } + ?> + = $icon ?> + + | +