/** * (non-PHPDoc) * @see \Icinga\Web\Form::onSuccess() For the method documentation. */ public function onSuccess() { foreach ($this->objects as $object) { /** @var \Icinga\Module\Monitoring\Object\Host $object */ $check = new ScheduleHostCheckCommand(); $check->setObject($object)->setOfAllServices($this->getElement('all_services')->isChecked()); $this->scheduleCheck($check, $this->request); } Notification::success($this->translatePlural('Scheduling host check..', 'Scheduling host checks..', count($this->objects))); return true; }
protected function restoreSchedule($hostname) { $host = $this->getHostObject($hostname); $cmd = new ScheduleHostCheckCommand(); $cmd->setObject($host)->setCheckTime($this->schedule[$hostname]['host']); $this->getTransport()->send($cmd); foreach ($this->schedule[$hostname]['services'] as $service => $time) { $service = $this->getServiceObject($hostname, $service); if ($time < time()) { continue; } $cmd = new ScheduleServiceCheckCommand(); $cmd->setObject($service)->setCheckTime($time); $this->getTransport()->send($cmd); } }