From a8ddf4c2df4a67c4ee6c78353817008bbb4fd468 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 3 May 2024 10:49:12 +0200 Subject: [PATCH] Add unreachable notification when server is unreachable in Server.php --- app/Models/Server.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Models/Server.php b/app/Models/Server.php index a265af729..54cc134aa 100644 --- a/app/Models/Server.php +++ b/app/Models/Server.php @@ -762,6 +762,11 @@ public function validateConnection() $server->settings()->update([ 'is_reachable' => false, ]); + if (data_get($server, 'unreachable_notification_sent') === false) { + ray('Server unreachable, sending notification...'); + $this->team?->notify(new Unreachable($this)); + $this->update(['unreachable_notification_sent' => true]); + } return ['uptime' => false, 'error' => $e->getMessage()]; } }