diff --git a/modules/monitoring/application/controllers/HostsController.php b/modules/monitoring/application/controllers/HostsController.php
index 19b501a88..2c9ebc20e 100644
--- a/modules/monitoring/application/controllers/HostsController.php
+++ b/modules/monitoring/application/controllers/HostsController.php
@@ -10,6 +10,7 @@ use Icinga\Module\Monitoring\Forms\Command\Object\ProcessCheckResultCommandForm;
use Icinga\Module\Monitoring\Forms\Command\Object\RemoveAcknowledgementCommandForm;
use Icinga\Module\Monitoring\Forms\Command\Object\ScheduleHostCheckCommandForm;
use Icinga\Module\Monitoring\Forms\Command\Object\ScheduleHostDowntimeCommandForm;
+use Icinga\Module\Monitoring\Forms\Command\Object\AddCommentCommandForm;
use Icinga\Module\Monitoring\Object\Host;
use Icinga\Module\Monitoring\Object\HostList;
use Icinga\Web\Url;
@@ -36,7 +37,12 @@ class Monitoring_HostsController extends Controller
'host_problem',
'host_handled',
'host_acknowledged',
- 'host_in_downtime'
+ 'host_in_downtime',
+ 'host_last_ack',
+ 'host_is_flapping',
+ 'host_last_comment',
+ 'host_output',
+ 'host_notifications_enabled'
));
$form
@@ -87,9 +93,13 @@ class Monitoring_HostsController extends Controller
'host_problem',
'host_handled',
'host_acknowledged',
- 'host_in_downtime'/*,
+ 'host_in_downtime',
+ 'host_last_ack',
+ 'host_is_flapping',
+ 'host_last_comment',
+ 'host_output',
+ 'host_notifications_enabled',/*,
'host_passive_checks_enabled',
- 'host_notifications_enabled',
'host_event_handler_enabled',
'host_flap_detection_enabled',
'host_active_checks_enabled',
@@ -133,6 +143,8 @@ class Monitoring_HostsController extends Controller
$this->view->rescheduleAllLink = Url::fromRequest()->setPath('monitoring/hosts/reschedule-check');
$this->view->downtimeAllLink = Url::fromRequest()->setPath('monitoring/hosts/schedule-downtime');
$this->view->processCheckResultAllLink = Url::fromRequest()->setPath('monitoring/hosts/process-check-result');
+ $this->view->addCommentLink = Url::fromRequest()->setPath('monitoring/hosts/add-comment');
+ $this->view->deleteCommentLink = Url::fromRequest()->setPath('monitoring/hosts/delete-comment');
$this->view->hostStates = $hostStates;
$this->view->objects = $this->hostList;
$this->view->unhandledObjects = $unhandledObjects;
@@ -149,6 +161,18 @@ class Monitoring_HostsController extends Controller
->setPath('monitoring/list/comments');
}
+ /**
+ * Add a host comments
+ */
+ public function addCommentAction()
+ {
+ $this->assertPermission('monitoring/command/comment/add');
+
+ $form = new AddCommentCommandForm();
+ $form->setTitle($this->translate('Add Host Comments'));
+ $this->handleCommandForm($form);
+ }
+
/**
* Acknowledge host problems
*/
diff --git a/modules/monitoring/application/views/scripts/hosts/show.phtml b/modules/monitoring/application/views/scripts/hosts/show.phtml
index 8655a31b1..b6cb454bf 100644
--- a/modules/monitoring/application/views/scripts/hosts/show.phtml
+++ b/modules/monitoring/application/views/scripts/hosts/show.phtml
@@ -1,116 +1,224 @@
+
+
+
+ = $this->icon('reschedule') ?>
+ = $this->translate('Commands') ?>
+
+ = sprintf(t('Issue commands on all %d selected services:'), count($objects)) ?>
+
= $this->translate('No hosts matching the filter'); ?>
-
= sprintf($this->translatePlural('%u Host', '%u Hosts', $hostCount), $hostCount); ?>
-
= $this->qlink(
- sprintf($this->translate('List all %u hosts'), $hostCount),
- $listAllLink
- ); ?>
+
+
= $checkNowForm; ?>
-
= $this->qlink(
- sprintf($this->translate('Reschedule the next check for all %u hosts'), $hostCount),
- $rescheduleAllLink,
- null,
- array('icon' => 'reschedule')
- ); ?>
-
= $this->qlink(
- sprintf($this->translate('Schedule a downtime for all %u hosts'), $hostCount),
- $downtimeAllLink,
- null,
- array('icon' => 'plug')
- ); ?>
-
= $this->qlink(
- sprintf($this->translate('Submit a passive check result for all %u hosts'), $hostCount),
- $processCheckResultAllLink,
- null,
- array('icon' => 'reply')
- ); ?>
- 0): ?>
+
-
= sprintf(
- $this->translatePlural(
- '%u Unhandled Host Problem',
- '%u Unhandled Host Problems',
- $unhandledCount
- ),
- $unhandledCount
- ); ?>
-
= $this->qlink(
- sprintf(
- $this->translatePlural(
- 'Schedule a downtime for %u unhandled host problem',
- 'Schedule a downtime for %u unhandled host problems',
- $unhandledCount
- ),
- $unhandledCount
- ),
- $downtimeUnhandledLink,
+ = $this->qlink(
+ $this->translate('Reschedule the next check'),
+ $rescheduleAllLink,
+ null,
+ array('icon' => 'reschedule')
+ ); ?>
+
+
+
+ = $this->qlink(
+ $this->translate('Schedule a downtime'),
+ $downtimeAllLink,
null,
array('icon' => 'plug')
- ); ?>
-
= $this->qlink(
- sprintf(
- $this->translatePlural(
- 'Acknowledge %u unhandled host problem',
- 'Acknowledge %u unhandled host problems',
+ ); ?>
+
+
+
+ = $this->qlink(
+ $this->translate('Submit a passive check result'),
+ $processCheckResultAllLink,
+ null,
+ array('icon' => 'reply')
+ ); ?>
+
+
+
+ = $this->qlink(
+ $this->translate('Add a comment'),
+ $addCommentLink,
+ null,
+ array('icon' => 'comment')
+ ); ?>
+
+
+
+ 0): ?>
+
+
+ = $this->icon('attention-alt') ?>
+ = $this->translatePlural(
+ 'Unhandled Problem',
+ 'Unhandled Problems',
+ $unhandledCount
+ ) ?>
+
+
+
+
+ = sprintf(
+ t('There are %s unhandled problems. Issue commands to the problematic hosts.'),
+ '' . $unhandledCount . ''
+ ) ?>
+
+
= $this->qlink(
+ sprintf(
+ $this->translatePlural(
+ 'Schedule a downtime for %u host',
+ 'Schedule a downtime for %u hosts',
+ $unhandledCount
+ ),
+ $unhandledCount
+ ),
+ $downtimeUnhandledLink,
+ null,
+ array('icon' => 'plug')
+ ); ?>
+
+
+
= $this->qlink(
+ sprintf(
+ $this->translatePlural(
+ 'Acknowledge %u unhandled host',
+ 'Acknowledge %u unhandled hosts',
+ $unhandledCount
+ ),
$unhandledCount
),
- $unhandledCount
- ),
- $acknowledgeUnhandledLink,
- null,
- array('icon' => 'ok')
- ); ?>
+ $acknowledgeUnhandledLink,
+ null,
+ array('icon' => 'ok')
+ ); ?>
+
+
+
+
0): ?>
-
= sprintf(
+ = $this->icon('ok', $this->translate('Acknowledgements')) ?> = $this->translate('Acknowledgements') ?>
+
+
= sprintf(
$this->translatePlural(
'%u Acknowledged Host Problem',
'%u Acknowledged Host Problems',
$acknowledgedCount
),
$acknowledgedCount
- ); ?>
+ ); ?>
+
= $removeAckForm ?>
+
0): ?>
-
= $this->qlink(
- sprintf(
+
+ = $this->translate('Downtimes') ?>
+
= sprintf(
$this->translatePlural(
- 'List %u host currently in downtime',
- 'List %u hosts currently in downtime',
+ '%u Host currently in downtime.',
+ '%u Hosts currently in downtime.',
$inDowntimeCount
),
$inDowntimeCount
- ),
- $inDowntimeLink,
- null,
- array('icon' => 'plug')
- ); ?>
+ ) ?> = $this->qlink(
+ $this->translate('Alle anzeigen'),
+ $inDowntimeLink,
+ null
+ ); ?>
+
+
+
getComments())) > 0): ?>
-
= $this->qlink(
- sprintf(
+ = $this->translate('Comments') ?>
+
+ = sprintf(
$this->translatePlural(
- 'List %u host comment',
- 'List %u host comments',
+ 'There is %u host comment.',
+ 'There are %u host comments.',
$commentCount
),
$commentCount
- ),
- $commentsLink,
- null,
- array('icon' => 'comment')
- ); ?>
+ ) ?>
+
+ = $this->qlink(
+ $this->translate('List all'),
+ $commentsLink,
+ null
+ ); ?>
+
+
+
+
+
+ fetchComments(); ?>
+ comments as $comment): ?>
+
+
+ populate(
+ array('comment_id' => $comment->id, 'redirect' => html_entity_decode($this->url))
+ );
+ $delCommentForm->setAction(
+ $this->url(
+ 'monitoring/service/delete-comment',
+ array('host' => $service->getName())
+ )
+ );
+ echo $delCommentForm;
+ ?>
+ (= ucfirst($comment->type) ?>):
+ |
+
+ = nl2br($comment->comment) ?>
+ |
+
+
+
+
+
+
+
\ No newline at end of file
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 cd79bce5b..6c910d46a 100644
--- a/modules/monitoring/application/views/scripts/partials/host/objects-header.phtml
+++ b/modules/monitoring/application/views/scripts/partials/host/objects-header.phtml
@@ -1,16 +1,91 @@
-compact): ?>
- = $tabs; ?>
-
+
+
+
+
+
0): ?>
-
- $count): ?>
- = sprintf('%s: %u', $this->translate(strtoupper($text)), $count); ?>
-
-
+
+