monitoring/commands: Support 'DISABLE_NOTIFICATIONS_EXPIRE_TIME'

refs #6593
This commit is contained in:
Eric Lippmann 2014-09-12 10:42:48 +02:00
parent 3f216f26ff
commit 1d54c7f836
2 changed files with 11 additions and 1 deletions

View File

@ -66,7 +66,7 @@ class DisableNotificationsExpireCommandForm extends CommandForm
{
$disableNotifications = new DisableNotificationsExpireCommand();
$disableNotifications
->setExpireTime($this->getElement('expire_time')->getValue());
->setExpireTime($this->getElement('expire_time')->getValue()->getTimestamp());
$this->getTransport($request)->send($disableNotifications);
Notification::success(mt('monitoring', 'Disabling host and service notifications..'));
return true;

View File

@ -2,6 +2,7 @@
namespace Icinga\Module\Monitoring\Command\Renderer;
use Icinga\Module\Monitoring\Command\Instance\DisableNotificationsExpireCommand;
use Icinga\Module\Monitoring\Command\Object\AcknowledgeProblemCommand;
use Icinga\Module\Monitoring\Command\Object\AddCommentCommand;
use Icinga\Module\Monitoring\Command\Object\DeleteCommentCommand;
@ -386,4 +387,13 @@ class IcingaCommandFileCommandRenderer implements IcingaCommandRendererInterface
}
return $commandString;
}
public function renderDisableNotificationsExpire(DisableNotificationsExpireCommand $command)
{
return sprintf(
'%s;%u',
'DISABLE_NOTIFICATIONS_EXPIRE_TIME',
$command->getExpireTime()
);
}
}