Skip to content

Commit 62a6c24

Browse files
committed
Add event when a node reports a bad health status
1 parent e50829b commit 62a6c24

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

api/v1/cem.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,14 @@ public function post() {
205205
$node->setCurrentJob($currentJob);
206206
}
207207

208+
if (!empty($healthStatus) && empty($node->getHealthStatus())) {
209+
// Health status changed
210+
$event = new Event(0, "Bad health status", date('Y-m-d H:i:s'),
211+
"The node with the id " . $node->getId() . " reported a bad health status. The status reported by the node is: " . $healthStatus,
212+
Define::EVENT_NODE, $currentJob, null, $node->getId());
213+
Factory::getEventFactory()->save($event);
214+
}
215+
208216
// Update information in DB
209217
$node->setCpu($cpu);
210218
$node->setMemoryUsed($memoryUsed);

0 commit comments

Comments
 (0)