From c2fc370273ffe1a6cc8722384fb4e594a74038a9 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 1 Feb 2019 14:01:20 +0100 Subject: [PATCH] CheckNowCommandForm: Ignore objects which have no active checks refs #3665 --- .../forms/Command/Object/CheckNowCommandForm.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/monitoring/application/forms/Command/Object/CheckNowCommandForm.php b/modules/monitoring/application/forms/Command/Object/CheckNowCommandForm.php index db0a619ac..fdeddea4d 100644 --- a/modules/monitoring/application/forms/Command/Object/CheckNowCommandForm.php +++ b/modules/monitoring/application/forms/Command/Object/CheckNowCommandForm.php @@ -58,6 +58,12 @@ class CheckNowCommandForm extends ObjectsCommandForm { foreach ($this->objects as $object) { /** @var \Icinga\Module\Monitoring\Object\MonitoredObject $object */ + if (! $object->active_checks_enabled + && ! $this->Auth()->hasPermission('monitoring/command/schedule-check') + ) { + continue; + } + if ($object->getType() === $object::TYPE_HOST) { $check = new ScheduleHostCheckCommand(); } else {