diff --git a/modules/monitoring/application/controllers/CommandController.php b/modules/monitoring/application/controllers/CommandController.php index e5a4bf09d..fe09db712 100644 --- a/modules/monitoring/application/controllers/CommandController.php +++ b/modules/monitoring/application/controllers/CommandController.php @@ -267,7 +267,7 @@ class Monitoring_CommandController extends ActionController $given = array_intersect_key($supported, $this->getRequest()->getParams()); if (empty($given)) { - throw new \Exception('Missing parameter, supported: '.implode(', ', $supported)); + throw new \Exception('Missing parameter, supported: '.implode(', ', array_flip($supported))); } if (isset($given['host'])) { @@ -815,19 +815,19 @@ class Monitoring_CommandController extends ActionController */ public function removedowntimeAction() { - $this->setSupportedParameters(array('downtimeid')); - $form = new CommandWithIdentifierForm(); + $this->setSupportedParameters(array('host', 'service', 'downtimeid')); + $form = new SingleArgumentCommandForm(); $form->setRequest($this->getRequest()); $form->setSubmitLabel(t('Delete Downtime')); - $form->setFieldName('downtimeid'); - $form->setFieldLabel(t('Downtime Id')); + $form->setParameterName('downtimeid'); $form->addNote(t('Delete a single downtime with the id shown above')); - + $form->setCommand('DEL_HOST_DOWNTIME', 'DEL_SVC_DOWNTIME'); + $form->setObjectIgnoreFlag(true); $this->setForm($form); if ($form->IsSubmittedAndValid() === true) { - $this->target->removeDowntime($this->view->objects); + $this->target->sendCommand($form->createCommand(), $this->view->objects); } } } diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index b6f5fc0a5..2719a266c 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -28,17 +28,17 @@ */ // {{{ICINGA_LICENSE_HEADER}}} -use \Icinga\Application\Benchmark; -use \Icinga\Data\Db\Query; -use \Icinga\File\Csv; -use \Icinga\Module\Monitoring\Controller as MonitoringController; -use \Icinga\Web\Hook; -use \Icinga\Web\Widget\Tabextension\DashboardAction; -use \Icinga\Web\Widget\Tabextension\OutputFormat; -use \Icinga\Web\Widget\Tabs; -use \Icinga\Module\Monitoring\Backend; -use \Icinga\Web\Widget\SortBox; -use \Icinga\Application\Config as IcingaConfig; +use Icinga\Application\Benchmark; +use Icinga\Data\Db\Query; +use Icinga\File\Csv; +use Icinga\Module\Monitoring\Controller as MonitoringController; +use Icinga\Web\Hook; +use Icinga\Web\Widget\Tabextension\DashboardAction; +use Icinga\Web\Widget\Tabextension\OutputFormat; +use Icinga\Web\Widget\Tabs; +use Icinga\Module\Monitoring\Backend; +use Icinga\Web\Widget\SortBox; +use Icinga\Application\Config as IcingaConfig; use Icinga\Module\Monitoring\DataView\Notification as NotificationView; use Icinga\Module\Monitoring\DataView\Downtime as DowntimeView; diff --git a/modules/monitoring/application/views/scripts/list/downtimes.phtml b/modules/monitoring/application/views/scripts/list/downtimes.phtml index 38d4f9cb2..0237d9c2c 100644 --- a/modules/monitoring/application/views/scripts/list/downtimes.phtml +++ b/modules/monitoring/application/views/scripts/list/downtimes.phtml @@ -1,5 +1,3 @@ -tabs->render($this); ?> - util()->showTime($d->getTimestamp()); } +$commandHelper = $this->getHelper('CommandForm'); ?> +tabs->render($this); ?> +
sortControl->render($this); ?> @@ -48,6 +49,7 @@ function formatDateString($self,$dateString){ Downtime ID Trigger ID Duration +   @@ -109,6 +111,22 @@ function formatDateString($self,$dateString){ util()->showHourMin(intval($downtime->downtime_duration)); ?> + $downtime->downtime_internal_downtime_id, + 'host' => $downtime->host_name + ); + + if ($downtime->object_type == 'service') { + $data['service'] = $downtime->service_description; + } + + echo $commandHelper->simpleForm( + 'removedowntime', + 'Remove Downtime', + $data + ); + ?> diff --git a/modules/monitoring/application/views/scripts/list/hosts.phtml b/modules/monitoring/application/views/scripts/list/hosts.phtml index f795aa7a6..6e2009ff1 100644 --- a/modules/monitoring/application/views/scripts/list/hosts.phtml +++ b/modules/monitoring/application/views/scripts/list/hosts.phtml @@ -1,22 +1,14 @@ -tabs->render($this); ?> - getHelper('MonitoringState'); ?> +tabs->render($this); ?>

Hosts Status

- sortControl->render($this); ?> paginationControl($hosts, null, null, array('preserve' => $this->preserve)); ?> - - - - - - - + @@ -27,11 +19,6 @@ $viewHelper = $this->getHelper('MonitoringState'); @@ -69,11 +56,11 @@ $viewHelper = $this->getHelper('MonitoringState'); host_active_checks_enabled): ?> host_passive_checks_enabled): ?> - {{ACTIVE_PASSIVE_CHECKS_DISABLED_ICON}} + - + @@ -89,32 +76,39 @@ $viewHelper = $this->getHelper('MonitoringState'); diff --git a/modules/monitoring/application/views/scripts/list/services.phtml b/modules/monitoring/application/views/scripts/list/services.phtml index e1190e9f5..c7fb858c6 100644 --- a/modules/monitoring/application/views/scripts/list/services.phtml +++ b/modules/monitoring/application/views/scripts/list/services.phtml @@ -1,141 +1,120 @@ -tabs->render($this); ?> - getHelper('MonitoringState'); ?> +tabs->render($this); ?>

Services Status

- sortControl->render($this); ?> paginationControl($services, null, null, array('preserve' => $this->preserve)); ?> -
StatusHost
-
host_unhandled_service_count): ?> - + host_unhandled_service_count; ?> - monitoringState($host, 'host')); ?>
Since - timeSince($host->host_last_state_change); ?> (host_current_check_attempt; ?>/host_max_check_attempts; ?>) + monitoringState($host, 'host')); ?>
+
+ Since timeSince($host->host_last_state_change); ?> + host_state > 0): ?> +
+ Attempt: host_current_check_attempt; ?>/host_max_check_attempts; ?> + (host_state_type === '1') ? 'Hard' : 'Soft'; ?>) + +
+ host_icon_image) : ?> +
+ +
+ - host_name ?> (host_address ?>) + host_name ?> - host_action_url)): ?> - Action - - host_notes_url)): ?> - Notes - - -
escape(substr(strip_tags($host->host_output), 0, 10000)); ?> +
+ escape(substr(strip_tags($host->host_output), 0, 10000)); ?> +
- - - - - - - - - href('monitoring/show/service',array( - 'host' => $service->host_name, - 'service' => $service->service_description - ) - ); - $hostLink = $this->href('monitoring/show/host',array( - 'host' => $service->host_name, - ) - ); + $serviceLink = $this->href( + 'monitoring/show/service', + array( + 'host' => $service->host_name, + 'service' => $service->service_description + ) + ); + $hostLink = $this->href( + 'monitoring/show/host', + array( + 'host' => $service->host_name, + ) + ); + $serviceStateName = strtolower($this->util()->getServiceStateName($service->service_state)); ?> activeRowHref === $serviceLink) ? 'class="active"' : ''; ?>> + + - - - - - - diff --git a/public/css/icons.css b/public/css/icons.css index f5508b888..ae314f4ff 100644 --- a/public/css/icons.css +++ b/public/css/icons.css @@ -1,104 +1,138 @@ +.icinga-icon-blank { + background: transparent; + display: inline-block; + width: 16px; + height: 16px; +} .icinga-icon-acknowledgement { - background: transparent url("../img/images/acknowledgement.png") center center no-repeat; + background: transparent url("../img/icons/acknowledgement.png") center center no-repeat; display: inline-block; width: 16px; height: 16px; } .icinga-icon-comment { - background: transparent url("../img/images/comment.png") center center no-repeat; + background: transparent url("../img/icons/comment.png") center center no-repeat; display: inline-block; width: 16px; height: 16px; } .icinga-icon-create { - background: transparent url("../img/images/create.png") center center no-repeat; + background: transparent url("../img/icons/create.png") center center no-repeat; display: inline-block; width: 16px; height: 16px; } .icinga-icon-dashboard { - background: transparent url("../img/images/dashboard.png") center center no-repeat; + background: transparent url("../img/icons/dashboard.png") center center no-repeat; display: inline-block; width: 16px; height: 16px; } .icinga-icon-disabled { - background: transparent url("../img/images/disabled.png") center center no-repeat; + background: transparent url("../img/icons/disabled.png") center center no-repeat; display: inline-block; width: 16px; height: 16px; } .icinga-icon-edit { - background: transparent url("../img/images/edit.png") center center no-repeat; + background: transparent url("../img/icons/edit.png") center center no-repeat; display: inline-block; width: 16px; height: 16px; } .icinga-icon-error { - background: transparent url("../img/images/error.png") center center no-repeat; + background: transparent url("../img/icons/error.png") center center no-repeat; display: inline-block; width: 16px; height: 16px; } .icinga-icon-flapping { - background: transparent url("../img/images/flapping.png") center center no-repeat; + background: transparent url("../img/icons/flapping.png") center center no-repeat; display: inline-block; width: 16px; height: 16px; } .icinga-icon-in-downtime { - background: transparent url("../img/images/in_downtime.png") center center no-repeat; + background: transparent url("../img/icons/in_downtime.png") center center no-repeat; display: inline-block; width: 16px; height: 16px; } .icinga-icon-remove { - background: transparent url("../img/images/remove.png") center center no-repeat; + background: transparent url("../img/icons/remove.png") center center no-repeat; display: inline-block; width: 16px; height: 16px; } .icinga-icon-save { - background: transparent url("../img/images/save.png") center center no-repeat; + background: transparent url("../img/icons/save.png") center center no-repeat; display: inline-block; width: 16px; height: 16px; } .icinga-icon-service { - background: transparent url("../img/images/service.png") center center no-repeat; + background: transparent url("../img/icons/service.png") center center no-repeat; display: inline-block; width: 16px; height: 16px; } .icinga-icon-submit { - background: transparent url("../img/images/submit.png") center center no-repeat; + background: transparent url("../img/icons/submit.png") center center no-repeat; display: inline-block; width: 16px; height: 16px; } .icinga-icon-unhandled { - background: transparent url("../img/images/unhandled.png") center center no-repeat; + background: transparent url("../img/icons/unhandled.png") center center no-repeat; display: inline-block; width: 16px; height: 16px; } .icinga-icon-user { - background: transparent url("../img/images/user.png") center center no-repeat; + background: transparent url("../img/icons/user.png") center center no-repeat; display: inline-block; width: 16px; height: 16px; } + +.icinga-icon-active-checks-disabled { + background: transparent url("../img/icons/active_checks_disabled.png") center center no-repeat; + display: inline-block; + width: 16px; + height: 16px; +} + +.icinga-icon-active-passive-checks-disabled { + background: transparent url("../img/icons/active_passive_checks_disabled.png") center center no-repeat; + display: inline-block; + width: 16px; + height: 16px; +} + +.icinga-icon-notification { + background: transparent url("../img/icons/notification.png") center center no-repeat; + display: inline-block; + width: 16px; + height: 16px; +} + +.icinga-icon-notification-disabled { + background: transparent url("../img/icons/notification_disabled.png") center center no-repeat; + display: inline-block; + width: 16px; + height: 16px; +} \ No newline at end of file diff --git a/public/css/main.css b/public/css/main.css index 2c1c64bd1..5d187866d 100644 --- a/public/css/main.css +++ b/public/css/main.css @@ -24,6 +24,18 @@ body { padding-top: 70px; } border: none; } +.inline-image { + display: inline-block; + width: 16px; + height: 16px; + background: #c0c0c0 center center no-repeat; +} + +.small-row { + font-size: 12px; + line-height: 16px; + display: block; +} /* ========================================================================== Icinga Design @@ -188,12 +200,10 @@ td { .output-text { font-size: 12px; - line-height: 14px; - display: inline-block; + line-height: 16px; + display: block; } - - /* ========================================================================== Forms ========================================================================== */ @@ -291,10 +301,11 @@ select.input-sm { background-color: #00cc33; /* xx */ } - +.tacheader-status-pending { + background-color: #bababa; +} /** Service status **/ - .tacheader-status-critical { background-color: #FF3300; } diff --git a/public/img/images/acknowledgement.png b/public/img/icons/acknowledgement.png similarity index 100% rename from public/img/images/acknowledgement.png rename to public/img/icons/acknowledgement.png diff --git a/public/img/icons/active_checks_disabled.png b/public/img/icons/active_checks_disabled.png new file mode 100644 index 000000000..ef86c5322 Binary files /dev/null and b/public/img/icons/active_checks_disabled.png differ diff --git a/public/img/icons/active_passive_checks_disabled.png b/public/img/icons/active_passive_checks_disabled.png new file mode 100644 index 000000000..3a44ebcf9 Binary files /dev/null and b/public/img/icons/active_passive_checks_disabled.png differ diff --git a/public/img/images/comment.png b/public/img/icons/comment.png similarity index 100% rename from public/img/images/comment.png rename to public/img/icons/comment.png diff --git a/public/img/images/create.png b/public/img/icons/create.png similarity index 100% rename from public/img/images/create.png rename to public/img/icons/create.png diff --git a/public/img/icons/csv.png b/public/img/icons/csv.png new file mode 100644 index 000000000..5b419179e Binary files /dev/null and b/public/img/icons/csv.png differ diff --git a/public/img/images/dashboard.png b/public/img/icons/dashboard.png similarity index 100% rename from public/img/images/dashboard.png rename to public/img/icons/dashboard.png diff --git a/public/img/images/disabled.png b/public/img/icons/disabled.png similarity index 100% rename from public/img/images/disabled.png rename to public/img/icons/disabled.png diff --git a/public/img/icons/downtime_end.png b/public/img/icons/downtime_end.png new file mode 100644 index 000000000..e1d0d9723 Binary files /dev/null and b/public/img/icons/downtime_end.png differ diff --git a/public/img/icons/downtime_start.png b/public/img/icons/downtime_start.png new file mode 100644 index 000000000..8e33280fb Binary files /dev/null and b/public/img/icons/downtime_start.png differ diff --git a/public/img/images/edit.png b/public/img/icons/edit.png similarity index 100% rename from public/img/images/edit.png rename to public/img/icons/edit.png diff --git a/public/img/images/error.png b/public/img/icons/error.png similarity index 100% rename from public/img/images/error.png rename to public/img/icons/error.png diff --git a/public/img/images/flapping.png b/public/img/icons/flapping.png similarity index 100% rename from public/img/images/flapping.png rename to public/img/icons/flapping.png diff --git a/public/img/icons/host.png b/public/img/icons/host.png new file mode 100644 index 000000000..33e2f5dba Binary files /dev/null and b/public/img/icons/host.png differ diff --git a/public/img/icons/hostgroup.png b/public/img/icons/hostgroup.png new file mode 100644 index 000000000..e71e3c92f Binary files /dev/null and b/public/img/icons/hostgroup.png differ diff --git a/public/img/images/in_downtime.png b/public/img/icons/in_downtime.png similarity index 100% rename from public/img/images/in_downtime.png rename to public/img/icons/in_downtime.png diff --git a/public/img/icons/json.png b/public/img/icons/json.png new file mode 100644 index 000000000..4d0ae632a Binary files /dev/null and b/public/img/icons/json.png differ diff --git a/public/img/icons/notification.png b/public/img/icons/notification.png new file mode 100644 index 000000000..ea805d561 Binary files /dev/null and b/public/img/icons/notification.png differ diff --git a/public/img/icons/notification_disabled.png b/public/img/icons/notification_disabled.png new file mode 100644 index 000000000..ec60e1813 Binary files /dev/null and b/public/img/icons/notification_disabled.png differ diff --git a/public/img/icons/pdf.png b/public/img/icons/pdf.png new file mode 100644 index 000000000..eefcef63b Binary files /dev/null and b/public/img/icons/pdf.png differ diff --git a/public/img/images/remove.png b/public/img/icons/remove.png similarity index 100% rename from public/img/images/remove.png rename to public/img/icons/remove.png diff --git a/public/img/images/save.png b/public/img/icons/save.png similarity index 100% rename from public/img/images/save.png rename to public/img/icons/save.png diff --git a/public/img/images/service.png b/public/img/icons/service.png similarity index 100% rename from public/img/images/service.png rename to public/img/icons/service.png diff --git a/public/img/icons/servicegroup.png b/public/img/icons/servicegroup.png new file mode 100644 index 000000000..38ee3529a Binary files /dev/null and b/public/img/icons/servicegroup.png differ diff --git a/public/img/images/submit.png b/public/img/icons/submit.png similarity index 100% rename from public/img/images/submit.png rename to public/img/icons/submit.png diff --git a/public/img/icons/success.png b/public/img/icons/success.png new file mode 100644 index 000000000..2f95639dd Binary files /dev/null and b/public/img/icons/success.png differ diff --git a/public/img/icons/uebersicht.png b/public/img/icons/uebersicht.png new file mode 100644 index 000000000..e94c443e3 Binary files /dev/null and b/public/img/icons/uebersicht.png differ diff --git a/public/img/images/unhandled.png b/public/img/icons/unhandled.png similarity index 100% rename from public/img/images/unhandled.png rename to public/img/icons/unhandled.png diff --git a/public/img/images/user.png b/public/img/icons/user.png similarity index 100% rename from public/img/images/user.png rename to public/img/icons/user.png
StatusServiceHostOutput
+ + - service_icon_image) : ?> - - - service_handled && $service->service_state > 0): ?> - {{UNHANDLED_ICON}} + service_acknowledged && !$service->service_in_downtime): ?> - {{ACKNOWLEDGED_ICON}} + service_is_flapping): ?> - {{FLAPPING_ICON}} + service_notifications_enabled): ?> - {{NOTIFICATIONS_DISABLED_ICON}} + service_in_downtime): ?> - {{IN_DOWNTIME_ICON}} + service_active_checks_enabled): ?> service_passive_checks_enabled): ?> - {{ACTIVE_PASSIVE_CHECKS_DISABLED_ICON}} + - {{ACTIVE_CHECKS_DISABLED_ICON}} + service_last_comment !== null): ?> - {{COMMENT_ICON}} + -
- service_state_type == 0): ?> - - {{SOFTSTATE_ICON}} - - - monitoringState($service, 'service')); ?> - Since  - timeSince($service->service_last_state_change); ?> + monitoringState($service, 'service')); ?>
+ +
+ Since timeSince($service->service_last_state_change); ?> + service_state): ?> +
+ Attempt: + service_current_check_attempt; ?>/service_max_check_attempts; ?> + (service_state_type === '1') ? 'Hard' : 'Soft'; ?>) + +
- - service_display_name; ?> - -
- - service_action_url)): ?> - Action - - - service_notes_url)): ?> - Notes - -
- host_handled && $service->host_state > 0): ?> - - {{UNHANDLED_ICON}} - + service_icon_image): ?> +
+ +
- - host_name; ?> - host_state != 0): ?> - (monitoringState($service, 'host')); ?>) - -
host_address ?> -
-
+ service_display_name; ?> + + on + host_name; ?> + host_state != 0): ?> + (monitoringState($service, 'host')); ?>) + + + +
escape(substr(strip_tags($service->service_output), 0, 10000)); ?> +