diff --git a/modules/monitoring/application/controllers/EventController.php b/modules/monitoring/application/controllers/EventController.php index 324cfb808..e17ffb97a 100644 --- a/modules/monitoring/application/controllers/EventController.php +++ b/modules/monitoring/application/controllers/EventController.php @@ -75,7 +75,6 @@ class EventController extends Controller ->add('event', array( 'title' => $label, 'label' => $label, - 'icon' => $icon, 'url' => Url::fromRequest(), 'active' => true )) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index b65a75c3f..f70126c45 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -281,6 +281,7 @@ class ListController extends Controller $this->setAutorefreshInterval(15); $notifications = $this->backend->select()->from('notification', array( + 'id', 'host_display_name', 'host_name', 'notification_contact_name', diff --git a/modules/monitoring/application/controllers/ShowController.php b/modules/monitoring/application/controllers/ShowController.php index 9c23b9929..2af7d46d8 100644 --- a/modules/monitoring/application/controllers/ShowController.php +++ b/modules/monitoring/application/controllers/ShowController.php @@ -30,6 +30,13 @@ class ShowController extends Controller { $contactName = $this->params->getRequired('contact_name'); + $this->getTabs()->add('contact-detail', [ + 'title' => $this->translate('Contact details'), + 'label' => $this->translate('Contact'), + 'url' => Url::fromRequest(), + 'active' => true + ]); + $query = $this->backend->select()->from('contact', array( 'contact_name', 'contact_id', @@ -63,6 +70,7 @@ class ShowController extends Controller $this->view->commands = $commands; $notifications = $this->backend->select()->from('notification', array( + 'id', 'host_name', 'service_description', 'notification_output', diff --git a/modules/monitoring/application/views/scripts/list/contactgroups.phtml b/modules/monitoring/application/views/scripts/list/contactgroups.phtml index 591b1d385..125aeeae8 100644 --- a/modules/monitoring/application/views/scripts/list/contactgroups.phtml +++ b/modules/monitoring/application/views/scripts/list/contactgroups.phtml @@ -30,7 +30,7 @@ if (! $this->compact): ?> contact_count ?> - + qlink( $contactGroup->contactgroup_name, 'monitoring/list/contacts', @@ -40,7 +40,7 @@ if (! $this->compact): ?> $contactGroup->contactgroup_name )) ) ?> - + contactgroup_name !== $contactGroup->contactgroup_alias): ?> contactgroup_alias ?> diff --git a/modules/monitoring/application/views/scripts/list/contacts.phtml b/modules/monitoring/application/views/scripts/list/contacts.phtml index f712ada8a..68f8d3eeb 100644 --- a/modules/monitoring/application/views/scripts/list/contacts.phtml +++ b/modules/monitoring/application/views/scripts/list/contacts.phtml @@ -25,7 +25,7 @@ peekAhead($this->compact) as $contact): ?> - + qlink( $contact->contact_name, 'monitoring/show/contact', @@ -37,7 +37,7 @@ ) ) ) ?> - + translate('Email') ?>: compact): ?> $stateName = Host::getStateText($notification->notification_state); } ?> - +
@@ -40,19 +40,51 @@ if (! $this->compact): ?>
- - icon('service', $this->translate('Service')); ?> - link()->service( - $notification->service_description, - $notification->service_display_name, - $notification->host_name, + '; + echo sprintf( + $this->translate('%s on %s', 'service on host'), + $this->qlink( + $notification->service_display_name, + 'monitoring/service/show', + [ + 'host' => $notification->host_name, + 'service' => $notification->service_description + ], + [ + 'title' => sprintf( + $this->translate('Show detailed information for service %s on host %s'), + $notification->service_display_name, + $notification->host_display_name + ) + ] + ), + $this->qlink( + $notification->host_display_name, + 'monitoring/host/show', + ['host' => $notification->host_name], + [ + 'title' => sprintf( + $this->translate('Show detailed information for host %s'), + $notification->host_display_name + ) + ] + ) + ); + echo ''; + } else { + echo $this->qlink( $notification->host_display_name, - 'rowaction' - ) ?> - - icon('host', $this->translate('Host')); ?> - link()->host($notification->host_name, $notification->host_display_name) ?> - + 'monitoring/host/show', + ['host' => $notification->host_name], + [ + 'title' => sprintf( + $this->translate('Show detailed information for host %s'), + $notification->host_display_name + ) + ] + ); + } ?> contact): ?>
notification_contact_name): ?> diff --git a/modules/monitoring/application/views/scripts/list/services.phtml b/modules/monitoring/application/views/scripts/list/services.phtml index 7deacaf59..0c7865316 100644 --- a/modules/monitoring/application/views/scripts/list/services.phtml +++ b/modules/monitoring/application/views/scripts/list/services.phtml @@ -61,33 +61,56 @@ if (! $this->compact): ?>
- iconImage()->service($service) ?> - showHost): ?>qlink( - $service->host_display_name - . ($service->host_state != 0 ? ' (' . Host::getStateText($service->host_state, true) . ')' : ''), - $hostLink, - null, - array( - 'title' => sprintf( - $this->translate('Show detailed information for host %s'), - $service->host_display_name - ) - ) - ) ?>: - qlink( - $service->service_display_name, - $serviceLink, - null, - array( - 'title' => sprintf( - $this->translate('Show detailed information for service %s on host %s'), - $service->service_display_name, - $service->host_display_name - ), - 'class' => 'rowaction' - ) - ) ?> - serviceFlags($service) ?> + + iconImage()->service($service) ?> + showHost) { + echo sprintf( + $this->translate('%s on %s', 'service on host'), + $this->qlink( + $service->service_display_name, + $serviceLink, + null, + array( + 'title' => sprintf( + $this->translate('Show detailed information for service %s on host %s'), + $service->service_display_name, + $service->host_display_name + ), + 'class' => 'rowaction' + ) + ), + $this->qlink( + $service->host_display_name + . ($service->host_state != 0 ? ' (' . Host::getStateText($service->host_state, true) . ')' : ''), + $hostLink, + null, + [ + 'title' => sprintf( + $this->translate('Show detailed information for host %s'), + $service->host_display_name + ) + ] + ) + ); + } else { + echo $this->qlink( + $service->service_display_name, + $serviceLink, + null, + array( + 'title' => sprintf( + $this->translate('Show detailed information for service %s on host %s'), + $service->service_display_name, + $service->host_display_name + ), + 'class' => 'rowaction' + ) + ); + } + ?> + + serviceFlags($service) ?>
diff --git a/modules/monitoring/application/views/scripts/partials/comment/comment-detail.phtml b/modules/monitoring/application/views/scripts/partials/comment/comment-detail.phtml index e16cba124..9b037a333 100644 --- a/modules/monitoring/application/views/scripts/partials/comment/comment-detail.phtml +++ b/modules/monitoring/application/views/scripts/partials/comment/comment-detail.phtml @@ -1,23 +1,38 @@
objecttype === 'service') { - echo $this->icon('service', $this->translate('Service')); - echo $this->qlink( - $comment->host_display_name . ': ' . $comment->service_display_name, - 'monitoring/service/show', - array( - 'host' => $comment->host_name, - 'service' => $comment->service_description + echo ''; + echo sprintf( + $this->translate('%s on %s', 'service on host'), + $this->qlink( + $comment->service_display_name, + 'monitoring/service/show', + [ + 'host' => $comment->host_name, + 'service' => $comment->service_description + ], + [ + 'title' => sprintf( + $this->translate('Show detailed information for service %s on host %s'), + $comment->service_display_name, + $comment->host_display_name + ), + 'class' => 'rowaction' + ] ), - array( - 'title' => sprintf( - $this->translate('Show detailed information for this comment about service %s on host %s'), - $comment->service_display_name, - $comment->host_display_name - ) + $this->qlink( + $comment->host_display_name, + 'monitoring/host/show', + ['host' => $comment->host_name], + [ + 'title' => sprintf( + $this->translate('Show detailed information for host %s'), + $comment->host_display_name + ) + ] ) ); + echo ''; } else { - echo $this->icon('host', $this->translate('Host')); echo $this->qlink( $comment->host_display_name, 'monitoring/host/show', diff --git a/modules/monitoring/application/views/scripts/partials/downtime/downtime-header.phtml b/modules/monitoring/application/views/scripts/partials/downtime/downtime-header.phtml index 9e733f7aa..a5c443aa4 100644 --- a/modules/monitoring/application/views/scripts/partials/downtime/downtime-header.phtml +++ b/modules/monitoring/application/views/scripts/partials/downtime/downtime-header.phtml @@ -9,24 +9,41 @@
- - icon('service', $this->translate('Service')); ?> qlink( - $downtime->host_display_name . ': ' . $downtime->service_display_name, - 'monitoring/service/show', - array( - 'host' => $downtime->host_name, - 'service' => $downtime->service_description + '; + echo sprintf( + $this->translate('%s on %s', 'service on host'), + $this->qlink( + $downtime->service_display_name, + 'monitoring/service/show', + [ + 'host' => $downtime->host_name, + 'service' => $downtime->service_description + ], + [ + 'title' => sprintf( + $this->translate('Show detailed information for service %s on host %s'), + $downtime->service_display_name, + $downtime->host_display_name + ), + 'class' => 'rowaction' + ] ), - array( - 'title' => sprintf( - $this->translate('Show detailed information for this downtime scheduled for service %s on host %s'), - $downtime->service_display_name, - $downtime->host_display_name - ) + $this->qlink( + $downtime->host_display_name, + 'monitoring/host/show', + ['host' => $downtime->host_name], + [ + 'title' => sprintf( + $this->translate('Show detailed information for host %s'), + $downtime->host_display_name + ) + ] ) - ); ?> - - icon('host', $this->translate('host')); ?> qlink( + ); + echo ''; + } else { + echo $this->qlink( $downtime->host_display_name, 'monitoring/host/show', array('host' => $downtime->host_name, 'downtime_id' => $downtime->id), @@ -36,8 +53,8 @@ $downtime->host_display_name ) ) - ); ?> - + ); + } ?> escape(sprintf( $downtime->is_flexible diff --git a/modules/monitoring/application/views/scripts/partials/event-history.phtml b/modules/monitoring/application/views/scripts/partials/event-history.phtml index c97b8d422..c9bae1aba 100644 --- a/modules/monitoring/application/views/scripts/partials/event-history.phtml +++ b/modules/monitoring/application/views/scripts/partials/event-history.phtml @@ -188,35 +188,51 @@ $rowAction = Url::fromPath('monitoring/event/show');
isOverview): ?> - qlink( - $event->host_display_name, - 'monitoring/host/show', - [ - 'host' => $event->host_name, - ], - [ - 'title' => sprintf( - $this->translate('Show detailed information for host %s'), - $event->host_display_name + '; + echo sprintf( + $this->translate('%s on %s', 'service on host'), + $this->qlink( + $event->service_display_name, + 'monitoring/service/show', + [ + 'host' => $event->host_name, + 'service' => $event->service_description + ], + [ + 'title' => sprintf( + $this->translate('Show detailed information for service %s on host %s'), + $event->service_display_name, + $event->host_display_name + ) + ] + ), + $this->qlink( + $event->host_display_name, + 'monitoring/host/show', + ['host' => $event->host_name], + [ + 'title' => sprintf( + $this->translate('Show detailed information for host %s'), + $event->host_display_name + ) + ] ) - ] - ) ?>: - qlink( - $event->service_display_name, - 'monitoring/service/show', - [ - 'host' => $event->host_name, - 'service' => $event->service_description - ], + ); + echo ''; + } else { + echo $this->qlink( + $event->host_display_name, + 'monitoring/host/show', + ['host' => $event->host_name], [ 'title' => sprintf( - $this->translate('Show detailed information for service %s on host %s'), - $event->service_display_name, + $this->translate('Show detailed information for host %s'), $event->host_display_name ) ] - ) ?> - + ); + } ?> nl2br($this->createTicketLinks($this->markdown($msg, ['class' => 'overview-plugin-output']))) ?>
diff --git a/modules/monitoring/application/views/scripts/partials/object/host-header.phtml b/modules/monitoring/application/views/scripts/partials/object/host-header.phtml index ac79fd225..4de4a0197 100644 --- a/modules/monitoring/application/views/scripts/partials/object/host-header.phtml +++ b/modules/monitoring/application/views/scripts/partials/object/host-header.phtml @@ -25,7 +25,7 @@ $linkHostName = ! ($url->getPath() === 'monitoring/host/show' && $url->getParam( echo '
'; } ?> - escape($object->host_display_name) ?> + escape($object->host_display_name) ?> host_display_name !== $object->host_name): ?> (escape($object->host_name) ?>) diff --git a/modules/monitoring/application/views/scripts/partials/object/service-header.phtml b/modules/monitoring/application/views/scripts/partials/object/service-header.phtml index 9a12404d8..318fe4985 100644 --- a/modules/monitoring/application/views/scripts/partials/object/service-header.phtml +++ b/modules/monitoring/application/views/scripts/partials/object/service-header.phtml @@ -22,7 +22,7 @@ $linkServiceName = ! ($url->getPath() === 'monitoring/service/show' && $url->get iconImage()->host($object) ?> - escape($object->host_display_name) ?> + escape($object->host_display_name) ?> host_display_name !== $object->host_name): ?> (escape($object->host_name) ?>) @@ -57,7 +57,7 @@ $linkServiceName = ! ($url->getPath() === 'monitoring/service/show' && $url->get )) . '">'; } ?> - escape($object->service_display_name) ?> + escape($object->service_display_name) ?> service_display_name !== $object->service_description): ?> (escape($object->service_description) ?>) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostnotificationQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostnotificationQuery.php index 21e804652..d9ce93bdb 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostnotificationQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostnotificationQuery.php @@ -34,7 +34,6 @@ class HostnotificationQuery extends IdoQuery 'host_display_name' => 'h.display_name COLLATE latin1_general_ci' ), 'history' => array( - 'id' => 'hn.notification_id', 'output' => null, 'state' => 'hn.state', 'timestamp' => 'UNIX_TIMESTAMP(hn.start_time)', @@ -54,6 +53,7 @@ class HostnotificationQuery extends IdoQuery 'instance_name' => 'i.instance_name' ), 'notifications' => array( + 'id' => 'hn.notification_id', 'host' => 'ho.name1 COLLATE latin1_general_ci', 'host_name' => 'ho.name1', 'notification_output' => 'hn.output', diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationQuery.php index f85195123..9af24f79b 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationQuery.php @@ -22,6 +22,7 @@ class NotificationQuery extends IdoQuery */ protected $columnMap = array( 'notifications' => array( + 'id' => 'n.id', 'instance_name' => 'n.instance_name', 'notification_contact_name' => 'n.notification_contact_name', 'notification_output' => 'n.notification_output', diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicenotificationQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicenotificationQuery.php index 3c94cac71..573854a3c 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicenotificationQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicenotificationQuery.php @@ -26,7 +26,6 @@ class ServicenotificationQuery extends IdoQuery 'notification_contact_name' => 'co.name1' ), 'history' => array( - 'id' => 'sn.notification_id', 'output' => null, 'state' => 'sn.state', 'timestamp' => 'UNIX_TIMESTAMP(sn.start_time)', @@ -54,6 +53,7 @@ class ServicenotificationQuery extends IdoQuery 'instance_name' => 'i.instance_name' ), 'notifications' => array( + 'id' => 'sn.notification_id', 'host' => 'so.name1 COLLATE latin1_general_ci', 'host_name' => 'so.name1', 'notification_output' => 'sn.output', diff --git a/modules/monitoring/public/css/module.less b/modules/monitoring/public/css/module.less index a7e2bd544..13beb6d98 100644 --- a/modules/monitoring/public/css/module.less +++ b/modules/monitoring/public/css/module.less @@ -175,6 +175,16 @@ } } +.service-on { + color: @text-color-light; + + > a { + color: @text-color; + letter-spacing: normal; + font-weight: bold; + } +} + // State table in the host and service multi-selection and detail views .host-detail-state, .service-detail-state { diff --git a/modules/monitoring/public/css/tables.less b/modules/monitoring/public/css/tables.less index efb4bdbf4..dffb19961 100644 --- a/modules/monitoring/public/css/tables.less +++ b/modules/monitoring/public/css/tables.less @@ -17,6 +17,10 @@ // Object link and comment author in the comment overview .comment-author { margin-bottom: 0.25em; + + > a { + font-weight: bold; + } } // Comment icons, e.g. persistent in the comment overview @@ -205,6 +209,10 @@ // Wraps links, icons and meta in overviews .state-header { .clearfix(); + + > a { + font-weight: bold; + } } // State icons, e.g. acknowledged in overviews @@ -259,5 +267,9 @@ > .history-message-output { flex: 1; + + > a { + font-weight: bold; + } } }