diff --git a/modules/monitoring/library/Monitoring/Command/Instance/ToggleActiveHostChecks.php b/modules/monitoring/library/Monitoring/Command/Instance/ToggleActiveHostChecks.php deleted file mode 100644 index 99ea2992f..000000000 --- a/modules/monitoring/library/Monitoring/Command/Instance/ToggleActiveHostChecks.php +++ /dev/null @@ -1,22 +0,0 @@ -enable === true ? 'START_EXECUTING_HOST_CHECKS' : 'STOP_EXECUTING_HOST_CHECKS'; - } -} diff --git a/modules/monitoring/library/Monitoring/Command/Instance/ToggleActiveServiceChecks.php b/modules/monitoring/library/Monitoring/Command/Instance/ToggleActiveServiceChecks.php deleted file mode 100644 index 3ad2afe25..000000000 --- a/modules/monitoring/library/Monitoring/Command/Instance/ToggleActiveServiceChecks.php +++ /dev/null @@ -1,22 +0,0 @@ -enable === true ? 'START_EXECUTING_SVC_CHECKS' : 'STOP_EXECUTING_SVC_CHECKS'; - } -} diff --git a/modules/monitoring/library/Monitoring/Command/Instance/ToggleEventHandlers.php b/modules/monitoring/library/Monitoring/Command/Instance/ToggleEventHandlers.php deleted file mode 100644 index e2e6cf3a2..000000000 --- a/modules/monitoring/library/Monitoring/Command/Instance/ToggleEventHandlers.php +++ /dev/null @@ -1,22 +0,0 @@ -enable === true ? 'ENABLE_EVENT_HANDLERS' : 'DISABLE_EVENT_HANDLERS'; - } -} diff --git a/modules/monitoring/library/Monitoring/Command/Instance/ToggleFlapDetection.php b/modules/monitoring/library/Monitoring/Command/Instance/ToggleFlapDetection.php deleted file mode 100644 index 2951d448d..000000000 --- a/modules/monitoring/library/Monitoring/Command/Instance/ToggleFlapDetection.php +++ /dev/null @@ -1,22 +0,0 @@ -enable === true ? 'ENABLE_FLAP_DETECTION' : 'DISABLE_FLAP_DETECTION'; - } -} diff --git a/modules/monitoring/library/Monitoring/Command/Instance/ToggleInstanceFeatureCommand.php b/modules/monitoring/library/Monitoring/Command/Instance/ToggleInstanceFeatureCommand.php new file mode 100644 index 000000000..01b26a009 --- /dev/null +++ b/modules/monitoring/library/Monitoring/Command/Instance/ToggleInstanceFeatureCommand.php @@ -0,0 +1,123 @@ +feature = (string) $feature; + return $this; + } + + /** + * Get the feature that is to be enabled or disabled + * + * @return string + */ + public function getFeature() + { + return $this->feature; + } + + /** + * Set whether the feature should be enabled or disabled + * + * @param bool $enabled + * + * @return $this + */ + public function setEnabled($enabled = true) + { + $this->enabled = (bool) $enabled; + return $this; + } + + /** + * Get whether the feature should be enabled or disabled + * + * @return bool + */ + public function getEnabled() + { + return $this->enabled; + } +} diff --git a/modules/monitoring/library/Monitoring/Command/Instance/ToggleNotifications.php b/modules/monitoring/library/Monitoring/Command/Instance/ToggleNotifications.php deleted file mode 100644 index 6b1d5e362..000000000 --- a/modules/monitoring/library/Monitoring/Command/Instance/ToggleNotifications.php +++ /dev/null @@ -1,54 +0,0 @@ -expireTime = $expireTime !== null ? (int) $expireTime : null; - return parent::disable(); - } - - /** - * (non-PHPDoc) - * @see \Icinga\Module\Monitoring\Command\IcingaCommand::getCommandString() For the method documentation. - */ - public function getCommandString() - { - if ($this->enable === true) { - return 'ENABLE_NOTIFICATIONS'; - } - if ($this->expireTime !== null) { - return sprintf( - '%s;%u;%u', - 'DISABLE_NOTIFICATIONS_EXPIRE_TIME', - time(), // Schedule time. According to the Icinga documentation schedule time has no effect currently - // and should be set to the current timestamp. - $this->expireTime - ); - } - return 'DISABLE_NOTIFICATIONS'; - } -} diff --git a/modules/monitoring/library/Monitoring/Command/Instance/ToggleObsessingOverHostChecks.php b/modules/monitoring/library/Monitoring/Command/Instance/ToggleObsessingOverHostChecks.php deleted file mode 100644 index 0584c5e9c..000000000 --- a/modules/monitoring/library/Monitoring/Command/Instance/ToggleObsessingOverHostChecks.php +++ /dev/null @@ -1,22 +0,0 @@ -enable === true ? 'START_OBSESSING_OVER_HOST_CHECKS' : 'STOP_OBSESSING_OVER_HOST_CHECKS'; - } -} diff --git a/modules/monitoring/library/Monitoring/Command/Instance/ToggleObsessingOverServiceChecks.php b/modules/monitoring/library/Monitoring/Command/Instance/ToggleObsessingOverServiceChecks.php deleted file mode 100644 index 86653a4ba..000000000 --- a/modules/monitoring/library/Monitoring/Command/Instance/ToggleObsessingOverServiceChecks.php +++ /dev/null @@ -1,22 +0,0 @@ -enable === true ? 'START_OBSESSING_OVER_SVC_CHECKS' : 'STOP_OBSESSING_OVER_SVC_CHECKS'; - } -} diff --git a/modules/monitoring/library/Monitoring/Command/Instance/TogglePassiveHostChecks.php b/modules/monitoring/library/Monitoring/Command/Instance/TogglePassiveHostChecks.php deleted file mode 100644 index 7ce45d7f0..000000000 --- a/modules/monitoring/library/Monitoring/Command/Instance/TogglePassiveHostChecks.php +++ /dev/null @@ -1,22 +0,0 @@ -enable === true ? 'ENABLE_PASSIVE_HOST_CHECKS' : 'DISABLE_PASSIVE_HOST_CHECKS'; - } -} diff --git a/modules/monitoring/library/Monitoring/Command/Instance/TogglePassiveServiceChecks.php b/modules/monitoring/library/Monitoring/Command/Instance/TogglePassiveServiceChecks.php deleted file mode 100644 index 391b372c6..000000000 --- a/modules/monitoring/library/Monitoring/Command/Instance/TogglePassiveServiceChecks.php +++ /dev/null @@ -1,22 +0,0 @@ -enable === true ? 'ENABLE_PASSIVE_SVC_CHECKS' : 'DISABLE_PASSIVE_SVC_CHECKS'; - } -} diff --git a/modules/monitoring/library/Monitoring/Command/Instance/TogglePerformanceData.php b/modules/monitoring/library/Monitoring/Command/Instance/TogglePerformanceData.php deleted file mode 100644 index 16091ca11..000000000 --- a/modules/monitoring/library/Monitoring/Command/Instance/TogglePerformanceData.php +++ /dev/null @@ -1,22 +0,0 @@ -enable === true ? 'ENABLE_PERFORMANCE_DATA' : 'DISABLE_PERFORMANCE_DATA'; - } -}