mirror of
https://github.com/napnap75/multiarch-docker-images.git
synced 2026-09-25 20:31:52 +02:00
- Introduced alerters package with base Alerter class and implementations for LogAlerter and GotifyAlerter. - Created fetchers package with abstract LogFetcher class and implementations for FileLogFetcher, LokiLogFetcher, and ParseableLogFetcher. - Added filters package with base Filter class and implementations for RegexpFilter and GeolocationFilter. - Implemented rules package with base AlertRule class and SimpleAlertRule for alerting logic. - Enhanced configuration handling with utilities for loading and validating JSON configuration. - Updated logging setup for better logging management. - Modified main application logic to utilize the new modular structure, improving maintainability and readability. - Updated config.json and config.schema.json to reflect changes in alerting and fetching configurations. - Added python-dateutil to requirements for date parsing functionality.
21 lines
476 B
Python
21 lines
476 B
Python
"""Standard output alerter implementation."""
|
|
|
|
import logging
|
|
import requests
|
|
from typing import Dict, Any
|
|
|
|
from .base import Alerter
|
|
|
|
logger = logging.getLogger("log-alert")
|
|
|
|
|
|
class LogAlerter(Alerter):
|
|
"""Concrete implementation for log alert manager."""
|
|
|
|
def __init__(self, config: Dict[str, Any]):
|
|
pass
|
|
|
|
def send_alert(self, title: str, message: str) -> None:
|
|
"""Send an alert to the log."""
|
|
logger.info(f"[ALERT] {title} / {message}")
|