|
@@ 49-55 (lines=7) @@
|
| 46 |
|
try { |
| 47 |
|
// If the service is not already in failure, |
| 48 |
|
// we check if there is a failure. |
| 49 |
|
if (false === $alreadyInFailure && $statusGuesser->isFailed($result)) { |
| 50 |
|
$incidentResource->createIncident([ |
| 51 |
|
'name' => str_replace('%service_name%', $service['name'], $this->getDefaultFailedIncidentMessage()), |
| 52 |
|
'service' => $result->getUrl()->getServiceUuid(), |
| 53 |
|
'status' => StatusGuesser::IDENTIFIED, |
| 54 |
|
]); |
| 55 |
|
} |
| 56 |
|
|
| 57 |
|
// If the service is already in failture, |
| 58 |
|
// we check if it's back to normal and create a incident resolver |
|
@@ 59-65 (lines=7) @@
|
| 56 |
|
|
| 57 |
|
// If the service is already in failture, |
| 58 |
|
// we check if it's back to normal and create a incident resolver |
| 59 |
|
if ($alreadyInFailure && $statusGuesser->isOk($result)) { |
| 60 |
|
$incidentResource->createIncident([ |
| 61 |
|
'name' => str_replace('%service_name%', $service['name'], $this->getDefaultResolvedIncidentMessage()), |
| 62 |
|
'service' => $result->getUrl()->getServiceUuid(), |
| 63 |
|
'status' => StatusGuesser::RESOLVED, |
| 64 |
|
]); |
| 65 |
|
} |
| 66 |
|
} catch (\Exception $e) { |
| 67 |
|
echo sprintf('An error has occured %s', $e->getMessage()); |
| 68 |
|
} |