diff --git a/modules/monitoring/application/forms/Command/Instance/ToggleInstanceFeaturesCommandForm.php b/modules/monitoring/application/forms/Command/Instance/ToggleInstanceFeaturesCommandForm.php
index ed50466fe..dbd786d5e 100644
--- a/modules/monitoring/application/forms/Command/Instance/ToggleInstanceFeaturesCommandForm.php
+++ b/modules/monitoring/application/forms/Command/Instance/ToggleInstanceFeaturesCommandForm.php
@@ -58,24 +58,27 @@ class ToggleInstanceFeaturesCommandForm extends CommandForm
*/
public function createElements(array $formData = array())
{
- if ((bool) $this->status->notifications_enabled) {
- if ($this->hasPermission('monitoring/command/feature/instance')) {
+ $notificationDescription = null;
+ $isIcinga2 = $this->getBackend()->isIcinga2($this->status->program_version);
+
+ if (! $isIcinga2) {
+ if ((bool) $this->status->notifications_enabled) {
+ if ($this->hasPermission('monitoring/command/feature/instance')) {
+ $notificationDescription = sprintf(
+ '%3$s',
+ $this->translate('Disable notifications for a specific time on a program-wide basis'),
+ $this->getView()->href('monitoring/health/disable-notifications'),
+ $this->translate('Disable temporarily')
+ );
+ } else {
+ $notificationDescription = null;
+ }
+ } elseif ($this->status->disable_notif_expire_time) {
$notificationDescription = sprintf(
- '%3$s',
- $this->translate('Disable notifications for a specific time on a program-wide basis'),
- $this->getView()->href('monitoring/health/disable-notifications'),
- $this->translate('Disable temporarily')
+ $this->translate('Notifications will be re-enabled in %s'),
+ $this->getView()->timeUntil($this->status->disable_notif_expire_time)
);
- } else {
- $notificationDescription = null;
}
- } elseif ($this->status->disable_notif_expire_time) {
- $notificationDescription = sprintf(
- $this->translate('Notifications will be re-enabled in %s'),
- $this->getView()->timeUntil($this->status->disable_notif_expire_time)
- );
- } else {
- $notificationDescription = null;
}
$toggleDisabled = $this->hasPermission('monitoring/command/feature/instance') ? null : '';
@@ -138,7 +141,7 @@ class ToggleInstanceFeaturesCommandForm extends CommandForm
)
);
- if (! $this->getBackend()->isIcinga2($this->status->program_version)) {
+ if (! $isIcinga2) {
$this->addElement(
'checkbox',
ToggleInstanceFeatureCommand::FEATURE_HOST_OBSESSING,