diff --git a/modules/monitoring/library/Monitoring/Command/Service/AddServiceComment.php b/modules/monitoring/library/Monitoring/Command/Service/AddServiceComment.php new file mode 100644 index 000000000..926084bbf --- /dev/null +++ b/modules/monitoring/library/Monitoring/Command/Service/AddServiceComment.php @@ -0,0 +1,34 @@ +serivce = (string) $service; + } + + public function getCommand() + { + return sprintf( + 'ADD_SVC_COMMENT;%s;%u;%s', + $this->host, + $this->persistent, + parent::getCommand() + ); + } +} diff --git a/modules/monitoring/library/Monitoring/Command/Service/ScheduleServiceDowntimeCommand.php b/modules/monitoring/library/Monitoring/Command/Service/ScheduleServiceDowntimeCommand.php new file mode 100644 index 000000000..4697be36b --- /dev/null +++ b/modules/monitoring/library/Monitoring/Command/Service/ScheduleServiceDowntimeCommand.php @@ -0,0 +1,59 @@ +service = $service; + return $this; + } + + /** + * Get the service to set in downtime + * + * @return Service + */ + public function getService() + { + return $this->service; + } + + /** + * (non-PHPDoc) + * @see \Icinga\Module\Monitoring\Command\IcingaCommand::getCommandString() For the method documentation. + */ + public function getCommandString() + { + return sprintf( + '%s;%s;%s;%s', + 'SCHEDULE_SVC_DOWNTIME', + $this->service->getHostName(), + $this->service->getName(), + parent::getCommandString() + ); + } +}