mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-26 23:34:08 +02:00
monitoring/commands: Fix the delete comment and delete downtime commands
They included the involved object's name which is wrong. refs #6593
This commit is contained in:
parent
9601942116
commit
70500be5f7
@ -322,22 +322,10 @@ class IcingaCommandFileCommandRenderer implements IcingaCommandRendererInterface
|
|||||||
|
|
||||||
public function renderDeleteComment(DeleteCommentCommand $command)
|
public function renderDeleteComment(DeleteCommentCommand $command)
|
||||||
{
|
{
|
||||||
$object = $command->getObject();
|
|
||||||
if ($command->getObject()->getType() === $command::TYPE_HOST) {
|
if ($command->getObject()->getType() === $command::TYPE_HOST) {
|
||||||
/** @var \Icinga\Module\Monitoring\Object\Host $object */
|
$commandString = 'DEL_HOST_COMMENT';
|
||||||
$commandString = sprintf(
|
|
||||||
'%s;%s',
|
|
||||||
'DEL_HOST_DOWNTIME',
|
|
||||||
$object->getName()
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
/** @var \Icinga\Module\Monitoring\Object\Service $object */
|
$commandString = 'DEL_SVC_COMMENT';
|
||||||
$commandString = sprintf(
|
|
||||||
'%s;%s;%s',
|
|
||||||
'DEL_SVC_COMMENT',
|
|
||||||
$object->getHost()->getName(),
|
|
||||||
$object->getName()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return sprintf(
|
return sprintf(
|
||||||
'%s;%u',
|
'%s;%u',
|
||||||
@ -348,22 +336,10 @@ class IcingaCommandFileCommandRenderer implements IcingaCommandRendererInterface
|
|||||||
|
|
||||||
public function renderDeleteDowntime(DeleteDowntimeCommand $command)
|
public function renderDeleteDowntime(DeleteDowntimeCommand $command)
|
||||||
{
|
{
|
||||||
$object = $command->getObject();
|
|
||||||
if ($command->getObject()->getType() === $command::TYPE_HOST) {
|
if ($command->getObject()->getType() === $command::TYPE_HOST) {
|
||||||
/** @var \Icinga\Module\Monitoring\Object\Host $object */
|
$commandString = 'DEL_HOST_DOWNTIME';
|
||||||
$commandString = sprintf(
|
|
||||||
'%s;%s',
|
|
||||||
'DEL_HOST_DOWNTIME',
|
|
||||||
$object->getName()
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
/** @var \Icinga\Module\Monitoring\Object\Service $object */
|
$commandString = 'DEL_SVC_DOWNTIME';
|
||||||
$commandString = sprintf(
|
|
||||||
'%s;%s;%s',
|
|
||||||
'DEL_SVC_DOWNTIME',
|
|
||||||
$object->getHost()->getName(),
|
|
||||||
$object->getName()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return sprintf(
|
return sprintf(
|
||||||
'%s;%u',
|
'%s;%u',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user