Private GIT

Skip to content
Snippets Groups Projects
Commit 059d0925 authored by loiclau's avatar loiclau Committed by Kev
Browse files

add multi poller dt

parent b9d44e87
Branches
Tags
No related merge requests found
...@@ -691,12 +691,20 @@ class CentreonRtDowntime extends CentreonObject ...@@ -691,12 +691,20 @@ class CentreonRtDowntime extends CentreonObject
throw new CentreonClapiException(self::MISSINGPARAMETER); throw new CentreonClapiException(self::MISSINGPARAMETER);
} }
$instanceList = $this->instanceObject->getInstanceId($resource); $existingPoller = array();
if (count($instanceList) == 0) { $unknownPoller = array();
throw new CentreonClapiException(self::OBJECT_NOT_FOUND . ' INSTANCE : ' . $resource); $listPoller = explode('|', $resource);
foreach ($listPoller as $poller) {
if ($this->sgObject->getInstanceId($poller)) {
$existingPoller[] = $poller;
} else {
$unknownPoller[] = $poller;
}
} }
$hostList = $this->instanceObject->getHostsByInstance($resource); foreach ($existingPoller as $poller) {
$hostList = $this->instanceObject->getHostsByInstance($poller);
//check add services with host with true in last param //check add services with host with true in last param
foreach ($hostList as $host) { foreach ($hostList as $host) {
$this->externalCmdObj->addHostDowntime( $this->externalCmdObj->addHostDowntime(
...@@ -710,4 +718,9 @@ class CentreonRtDowntime extends CentreonObject ...@@ -710,4 +718,9 @@ class CentreonRtDowntime extends CentreonObject
); );
} }
} }
if (count($unknownPoller)) {
throw new CentreonClapiException(self::OBJECT_NOT_FOUND . ' INSTANCE : ' . implode('|', $unknownPoller));
}
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment