-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement send_notifcation() for node monitor tracker
- Loading branch information
1 parent
86352c0
commit 7fca29a
Showing
2 changed files
with
12 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
from typing import List | ||
from node_monitor.bot_email import EmailBot | ||
|
||
class NodeMonitorTracker: | ||
def __init__(self, slack_token: str) -> None: | ||
raise NotImplementedError | ||
def __init__(self, email_bot: EmailBot, recipients: List[str]) -> None: | ||
self.email_bot = email_bot | ||
self.recipients = recipients | ||
|
||
def send_notification() -> None: | ||
raise NotImplementedError | ||
def send_notification(self) -> None: | ||
subject = "🚨 Node Monitor is Down 🚨" | ||
body = "Node Monitor is down. Restart required immediately!" | ||
self.email_bot.send_emails(self.recipients, subject, body) | ||
|
||
def check_server_status() -> bool: | ||
def check_server_status(self) -> bool: | ||
raise NotImplementedError | ||
|
||
|