mirror of
https://forgejo.altau.su/lego/lego-monitoring.git
synced 2026-03-10 04:41:10 +00:00
network monitoring
This commit is contained in:
parent
8af7b683b6
commit
8b18d407d7
21 changed files with 434 additions and 53 deletions
|
|
@ -18,8 +18,12 @@ async def get_client() -> TelegramClient:
|
|||
|
||||
def format_message(alert: Alert, note: str) -> str:
|
||||
severity_emoji = SEVERITY_TO_EMOJI[alert.severity]
|
||||
note_formatted = f" - <i>{note}</i>" if note else ""
|
||||
message = f"{severity_emoji} {alert.alert_type} Alert{note_formatted}\n{alert.message}"
|
||||
note_formatted = f"{note}, " if note else ""
|
||||
if "ongoing" in note_formatted:
|
||||
note_formatted += f"since {alert.created.isoformat()}"
|
||||
else:
|
||||
note_formatted += f"at {alert.created.isoformat()}"
|
||||
message = f"{severity_emoji} {alert.alert_type} Alert - <i>{note_formatted}</i>\n{alert.message}"
|
||||
return message
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue