diff --git a/library/Icingadb/Common/HostLinks.php b/library/Icingadb/Common/HostLinks.php index 77183a9e..d390ef7b 100644 --- a/library/Icingadb/Common/HostLinks.php +++ b/library/Icingadb/Common/HostLinks.php @@ -22,6 +22,11 @@ abstract class HostLinks return Url::fromPath('icingadb/host/check-now', ['name' => $host->name]); } + public static function scheduleCheck(Host $host) + { + return Url::fromPath('icingadb/host/schedule-check', ['name' => $host->name]); + } + public static function cancelDowntime(Host $host) { return Url::fromPath('icingadb/host/delete-downtime', ['name' => $host->name]); diff --git a/library/Icingadb/Common/ServiceLinks.php b/library/Icingadb/Common/ServiceLinks.php index 150fc467..ce2043c4 100644 --- a/library/Icingadb/Common/ServiceLinks.php +++ b/library/Icingadb/Common/ServiceLinks.php @@ -29,6 +29,13 @@ abstract class ServiceLinks ); } + public static function scheduleCheck(Service $service, Host $host) + { + return Url::fromPath( + 'icingadb/service/schedule-check', ['name' => $service->name, 'host.name' => $host->name] + ); + } + public static function cancelDowntime(Service $service, Host $host) { return Url::fromPath( diff --git a/library/Icingadb/Widget/Detail/QuickActions.php b/library/Icingadb/Widget/Detail/QuickActions.php index e6ee57f7..a611f640 100644 --- a/library/Icingadb/Widget/Detail/QuickActions.php +++ b/library/Icingadb/Widget/Detail/QuickActions.php @@ -90,6 +90,21 @@ class QuickActions extends BaseHtmlElement 'Schedule a downtime to suppress all problem notifications within a specific period of time' ); } + + if ( + $this->getAuth()->hasPermission('monitoring/command/schedule-check') + || ( + $this->object->active_checks_enabled + && $this->getAuth()->hasPermission('monitoring/command/schedule-check/active-only') + ) + ) { + $this->assembleAction( + 'scheduleCheck', + 'Reschedule', + 'icon-calendar-empty', + 'Schedule the next active check at a different time than the current one' + ); + } } protected function assembleAction($action, $label, $icon, $title)