Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
Fix of the acknowledgment concerning the "sticky" option from APIv2 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
callapa committed Dec 13, 2021
1 parent b6016d7 commit d217fd8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Centreon/Domain/Engine/EngineService.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ class EngineService extends AbstractCentreonService implements
*/
private $engineConfigurationRepository;

private const ACKNOWLEDGEMENT_WITH_STICKY_OPTION = 2;
private const ACKNOWLEDGEMENT_WITH_NO_STICKY_OPTION = 0;

/**
* CentCoreService constructor.
*
Expand Down Expand Up @@ -96,7 +99,9 @@ public function addHostAcknowledgement(Acknowledgement $acknowledgement, Host $h
$preCommand = sprintf(
'ACKNOWLEDGE_HOST_PROBLEM;%s;%d;%d;%d;%s;%s',
$host->getName(),
(int) $acknowledgement->isSticky(),
$acknowledgement->isSticky()
? self::ACKNOWLEDGEMENT_WITH_STICKY_OPTION
: self::ACKNOWLEDGEMENT_WITH_NO_STICKY_OPTION,
(int) $acknowledgement->isNotifyContacts(),
(int) $acknowledgement->isPersistentComment(),
$this->contact->getAlias(),
Expand All @@ -123,7 +128,9 @@ public function addServiceAcknowledgement(Acknowledgement $acknowledgement, Serv
'ACKNOWLEDGE_SVC_PROBLEM;%s;%s;%d;%d;%d;%s;%s',
$service->getHost()->getName(),
$service->getDescription(),
(int) $acknowledgement->isSticky(),
$acknowledgement->isSticky()
? self::ACKNOWLEDGEMENT_WITH_STICKY_OPTION
: self::ACKNOWLEDGEMENT_WITH_NO_STICKY_OPTION,
(int) $acknowledgement->isNotifyContacts(),
(int) $acknowledgement->isPersistentComment(),
$this->contact->getAlias(),
Expand Down

0 comments on commit d217fd8

Please sign in to comment.