diff --git a/modules/monitoring/application/controllers/HostsController.php b/modules/monitoring/application/controllers/HostsController.php
index a66e478a2..293e0fd66 100644
--- a/modules/monitoring/application/controllers/HostsController.php
+++ b/modules/monitoring/application/controllers/HostsController.php
@@ -113,11 +113,11 @@ class Monitoring_HostsController extends Controller
'host_is_flapping',
'host_last_comment',
'host_output',
- 'host_notifications_enabled',/*,
- 'host_passive_checks_enabled',
- 'host_event_handler_enabled',
- 'host_flap_detection_enabled',
+ 'host_notifications_enabled',
'host_active_checks_enabled',
+ 'host_passive_checks_enabled'
+ /*'host_event_handler_enabled',
+ 'host_flap_detection_enabled',
'host_obsessing'*/
));
diff --git a/modules/monitoring/application/controllers/ServicesController.php b/modules/monitoring/application/controllers/ServicesController.php
index c8a406ca3..68ff7f2e8 100644
--- a/modules/monitoring/application/controllers/ServicesController.php
+++ b/modules/monitoring/application/controllers/ServicesController.php
@@ -78,7 +78,9 @@ class Monitoring_ServicesController extends Controller
'service_notifications_enabled',
'service_output',
'service_last_ack',
- 'service_last_comment'
+ 'service_last_comment',
+ 'service_active_checks_enabled',
+ 'service_passive_checks_enabled'
));
$form
@@ -129,12 +131,12 @@ class Monitoring_ServicesController extends Controller
'service_is_flapping',
'service_notifications_enabled',
'service_last_comment',
- 'service_last_ack'
- /*,
- 'service_passive_checks_enabled',
+ 'service_last_ack',
+ 'service_active_checks_enabled',
+ 'service_passive_checks_enabled'
+ /*
'service_event_handler_enabled',
'service_flap_detection_enabled',
- 'service_active_checks_enabled',
'service_obsessing'*/
));
diff --git a/modules/monitoring/application/views/helpers/HostFlags.php b/modules/monitoring/application/views/helpers/HostFlags.php
new file mode 100644
index 000000000..97e6fbf3d
--- /dev/null
+++ b/modules/monitoring/application/views/helpers/HostFlags.php
@@ -0,0 +1,39 @@
+host_handled && $host->host_state > 0) {
+ $icons[] = $this->view->icon('attention-alt', $this->view->translate('Unhandled'));
+ }
+ if ($host->host_acknowledged) {
+ $icons[] = $this->view->icon('ok', $this->view->translate('Acknowledged'));
+ }
+ if ($host->host_is_flapping) {
+ $icons[] = $this->view->icon('flapping', $this->view->translate('Flapping'));
+ }
+ if (! $host->host_notifications_enabled) {
+ $icons[] = $this->view->icon('bell-off-empty', $this->view->translate('Notifications Disabled'));
+ }
+ if ($host->host_in_downtime) {
+ $icons[] = $this->view->icon('plug', $this->view->translate('In Downtime'));
+ }
+ if (! $host->host_active_checks_enabled) {
+ if (! $host->host_passive_checks_enabled) {
+ $icons[] = $this->view->icon('eye-off', $this->view->translate('Active And Passive Checks Disabled'));
+ } else {
+ $icons[] = $this->view->icon('eye-off', $this->view->translate('Active Checks Disabled'));
+ }
+ }
+ if (isset($host->host_last_comment) && $host->host_last_comment !== null) {
+ $icons[] = $this->view->icon('comment', $this->view->translate('Last Comment: ') . $host->host_last_comment);
+ }
+ return $icons;
+ }
+}
\ No newline at end of file
diff --git a/modules/monitoring/application/views/helpers/SelectionToolbar.php b/modules/monitoring/application/views/helpers/SelectionToolbar.php
deleted file mode 100644
index 7332b5c01..000000000
--- a/modules/monitoring/application/views/helpers/SelectionToolbar.php
+++ /dev/null
@@ -1,24 +0,0 @@
-'
- . ' Show All ';
- } else {
- return '';
- }
- }
-}
diff --git a/modules/monitoring/application/views/helpers/ServiceFlags.php b/modules/monitoring/application/views/helpers/ServiceFlags.php
new file mode 100644
index 000000000..7e71bebda
--- /dev/null
+++ b/modules/monitoring/application/views/helpers/ServiceFlags.php
@@ -0,0 +1,40 @@
+service_handled && $service->service_state > 0) {
+ $icons[] = $this->view->icon('attention-alt', $this->view->translate('Unhandled'));
+ }
+ if ($service->service_acknowledged && !$service->service_in_downtime) {
+ $icons[] = $this->view->icon('ok', $this->view->translate('Acknowledged') . (
+ $service->service_last_ack ? ': ' . $service->service_last_ack : ''
+ ));
+ }
+ if ($service->service_is_flapping) {
+ $icons[] = $this->view->icon('flapping', $this->view->translate('Flapping')) ;
+ }
+ if (!$service->service_notifications_enabled) {
+ $icons[] = $this->view->icon('bell-off-empty', $this->view->translate('Notifications Disabled'));
+ }
+ if ($service->service_in_downtime) {
+ $icons[] = $this->view->icon('plug', $this->view->translate('In Downtime'));
+ }
+ if (isset($service->service_last_comment) && $service->service_last_comment !== null) {
+ $icons[] = $this->view->icon(
+ 'comment',
+ $this->view->translate('Last Comment: ') . $service->service_last_comment
+ );
+ }
+ if (!$service->service_active_checks_enabled) {
+ if (!$service->service_passive_checks_enabled) {
+ $icons[] = $this->view->icon('eye-off', $this->view->translate('Active And Passive Checks Disabled'));
+ } else {
+ $icons[] = $this->view->icon('eye-off', $this->view->translate('Active Checks Disabled'));
+ }
+ }
+ return $icons;
+ }
+}
\ No newline at end of file
diff --git a/modules/monitoring/application/views/scripts/list/hosts.phtml b/modules/monitoring/application/views/scripts/list/hosts.phtml
index dac8d7dde..9de57c384 100644
--- a/modules/monitoring/application/views/scripts/list/hosts.phtml
+++ b/modules/monitoring/application/views/scripts/list/hosts.phtml
@@ -13,7 +13,6 @@ if ($this->compact): ?>
= $this->sortControl->render($this) ?>
= $this->widget('limiter')->setMaxLimit($this->hosts->count()) ?>
= $this->paginationControl($hosts, null, null, array('preserve' => $this->preserve)) ?>
-= $this->selectionToolbar('multi', $this->href('monitoring/hosts/show?' . $this->filter->toQueryString())) ?>
@@ -43,38 +42,7 @@ if ($hosts->count() === 0) {
$hostStateName = Host::getStateText($host->host_state);
$hostLink = $this->href('monitoring/host/show', array('host' => $host->host_name));
- $icons = array();
- if (! $host->host_handled && $host->host_state > 0){
- $icons[] = $this->icon('attention-alt', $this->translate('Unhandled'));
- }
- if ($host->host_acknowledged) {
- $icons[] = $this->icon('ok', $this->translate('Acknowledged'));
- }
-
- if ($host->host_is_flapping) {
- $icons[] = $this->icon('flapping', $this->translate('Flapping'));
- }
-
- if (! $host->host_notifications_enabled) {
- $icons[] = $this->icon('bell-off-empty', $this->translate('Notifications Disabled'));
- }
-
- if ($host->host_in_downtime) {
- $icons[] = $this->icon('plug', $this->translate('In Downtime'));
- }
-
- if (! $host->host_active_checks_enabled) {
- if (! $host->host_passive_checks_enabled) {
- $icons[] = $this->icon('eye-off', $this->translate('Active And Passive Checks Disabled'));
- } else {
- $icons[] = $this->icon('eye-off', $this->translate('Active Checks Disabled'));
- }
- }
-
- if (isset($host->host_last_comment) && $host->host_last_comment !== null) {
- $icons[] = $this->icon('comment', $this->translate('Last Comment: ') . $host->host_last_comment);
- }
?>
@@ -94,7 +62,7 @@ if ($hosts->count() === 0) {
host_icon_image && ! preg_match('/[\'"]/', $host->host_icon_image)): ?>
= $this->icon($this->resolveMacros($host->host_icon_image, $host)) ?>
- = implode(' ', $icons) ?>
+ = implode(' ', $this->hostFlags($host)) ?>
= $this->qlink(
$host->host_display_name,
$hostLink,
diff --git a/modules/monitoring/application/views/scripts/list/services.phtml b/modules/monitoring/application/views/scripts/list/services.phtml
index 636303b6e..7f62904f2 100644
--- a/modules/monitoring/application/views/scripts/list/services.phtml
+++ b/modules/monitoring/application/views/scripts/list/services.phtml
@@ -66,39 +66,7 @@ foreach ($services as $service):
= $this->perfdata($service->service_perfdata, true, 8) ?>
- service_handled && $service->service_state > 0): ?>
- = $this->icon('attention-alt', $this->translate('Unhandled')) ?>
-
-
- service_acknowledged && !$service->service_in_downtime): ?>
- = $this->icon('ok', $this->translate('Acknowledged') . (
- $service->service_last_ack ? ': ' . $service->service_last_ack : ''
- )) ?>
-
-
- service_is_flapping): ?>
- = $this->icon('flapping', $this->translate('Flapping')) ?>
-
-
- service_notifications_enabled): ?>
- = $this->icon('bell-off-empty', $this->translate('Notifications Disabled')) ?>
-
-
- service_in_downtime): ?>
- = $this->icon('plug', $this->translate('In Downtime')) ?>
-
-
- service_last_comment) && $service->service_last_comment !== null): ?>
- = $this->icon('comment', $this->translate('Last Comment: ') . $service->service_last_comment) ?>
-
-
- service_active_checks_enabled): ?>
- service_passive_checks_enabled): ?>
- = $this->icon('eye-off', $this->translate('Active And Passive Checks Disabled')) ?>
-
- = $this->icon('eye-off', $this->translate('Active Checks Disabled')) ?>
-
-
+ = implode(' ', $this->serviceFlags($service)); ?>
service_icon_image && ! preg_match('/[\'"]/', $service->service_icon_image)): ?>
= $this->icon($this->resolveMacros($service->service_icon_image, $service)) ?>
diff --git a/modules/monitoring/application/views/scripts/partials/host/objects-header.phtml b/modules/monitoring/application/views/scripts/partials/host/objects-header.phtml
index f6ea43d84..d47bd59e3 100644
--- a/modules/monitoring/application/views/scripts/partials/host/objects-header.phtml
+++ b/modules/monitoring/application/views/scripts/partials/host/objects-header.phtml
@@ -15,7 +15,7 @@ $hiddenRich = array();
0): ?>
-
+
@@ -23,71 +23,30 @@ $hiddenRich = array();
5) {
- $desc = $host->getName();
- $hidden[] = $desc;
- $hiddenRich[] = sprintf("%s", $host->getStateText($host->host_state) ,$desc);
continue;
}
?>
= Host::getStateText($host->host_state, true); ?>
|
-
- host_handled && $host->host_state > 0): ?>
- = $this->icon('attention-alt', $this->translate('Unhandled')) ?>
-
-
- host_acknowledged && !$host->host_in_downtime): ?>
- = $this->icon('ok', $this->translate('Acknowledged') . (
- $host->host_last_ack ? ': ' . $host->host_last_ack : ''
- )) ?>
-
-
- host_is_flapping): ?>
- = $this->icon('flapping', $this->translate('Flapping')) ?>
-
-
- host_notifications_enabled): ?>
- = $this->icon('bell-off-empty', $this->translate('Notifications Disabled')) ?>
-
-
- host_in_downtime): ?>
- = $this->icon('plug', $this->translate('In Downtime')) ?>
-
-
- host_last_comment) && $host->host_last_comment !== null): ?>
- = $this->icon('comment', $this->translate('Last Comment: ') . $host->host_last_comment) ?>
-
- |
+ = implode(' ', $this->hostFlags($host)) ?> |
= $this->escape($host->getName()); ?> |
= $this->escape($host->host_output) ?> |
-
-
-
- ' . join(' ', $hiddenRich) . '"' : ''; ?>
- title="= join(', ', $hidden) ?>">
- qlink(
- count($hidden) ? sprintf(
- $this->translate('%d more ...'),
- count($hidden)
- ) : $this->translate('list all ...'),
- $listAllLink,
- null,
- array('data-base-target' => '_next')
- );
- ?>
-
- |
-
-
-
+
-
-
+
+ =
+ $this->qlink(
+ sprintf($this->translate('list all %d hosts ...'), $i),
+ $listAllLink,
+ null,
+ array('data-base-target' => '_next')
+ );
+ ?>
+
+
diff --git a/modules/monitoring/application/views/scripts/partials/service/objects-header.phtml b/modules/monitoring/application/views/scripts/partials/service/objects-header.phtml
index 3880e4473..e80fe2c0b 100644
--- a/modules/monitoring/application/views/scripts/partials/service/objects-header.phtml
+++ b/modules/monitoring/application/views/scripts/partials/service/objects-header.phtml
@@ -22,77 +22,29 @@ use Icinga\Module\Monitoring\Object\Service;
|
5 && $i < 20) {
- $desc = $service->getName() . ' on ' . $service->getHost()->getName();
- $hidden[] = $desc;
- $hiddenRich[] = sprintf("%s", $service->getStateText($service->service_state) ,$desc);
- }
- if ($i == 20) {
- $hiddenRich[] = '...';
- }
- if ($i > 5) {
+ if ($i ++ > 5) {
continue;
}
?>
-
= Service::getStateText($service->service_state, true); ?>
|
-
- service_handled && $service->service_state > 0): ?>
- = $this->icon('attention-alt', $this->translate('Unhandled')) ?>
-
-
- service_acknowledged && !$service->service_in_downtime): ?>
- = $this->icon('ok', $this->translate('Acknowledged') . (
- $service->service_last_ack ? ': ' . $service->service_last_ack : ''
- )) ?>
-
-
- service_is_flapping): ?>
- = $this->icon('flapping', $this->translate('Flapping')) ?>
-
-
- service_notifications_enabled): ?>
- = $this->icon('bell-off-empty', $this->translate('Notifications Disabled')) ?>
-
-
- service_in_downtime): ?>
- = $this->icon('plug', $this->translate('In Downtime')) ?>
-
-
- service_last_comment) && $service->service_last_comment !== null): ?>
- = $this->icon('comment', $this->translate('Last Comment: ') . $service->service_last_comment) ?>
-
- |
+ = implode(' ', $this->serviceFlags($service)) ?> |
= $this->escape($service->getName()); ?> |
= $this->escape($service->getHost()->getName()); ?> |
= $this->escape($service->service_output) ?> |
-
-
-
- ' . join(' ', $hiddenRich) . '"' : ''; ?>
- title="= join(', ', $hidden) ?>">
-
- qlink(
- count($hidden) ? sprintf(
- $this->translate('%d more ...'),
- count($hidden)
- ) : $this->translate('list all ...'),
- $listAllLink,
- null,
- array('data-base-target' => '_next')
- );
- ?>
-
- |
-
-
+
+ qlink(
+ sprintf($this->translate('List all %d services ...'), $i),
+ $listAllLink,
+ null,
+ array('data-base-target' => '_next')
+ );
+ ?>
+