NextcloudLogAlert/README.md
2025-01-30 12:24:35 +00:00

77 lines
2.3 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Nextcloud Log Alert 🚀
**Automatisierte Überwachung und Benachrichtigung von Nextcloud-Logs via Discord Webhook**
## 📌 Überblick
Dieses Projekt bietet eine einfache Möglichkeit, Nextcloud-Logeinträge automatisch zu überwachen und relevante Meldungen an einen Discord-Kanal zu senden.
Es nutzt ein Python-Skript, das über einen systemd-Service automatisch gestartet wird und alle 30 Sekunden neue Logeinträge überprüft.
## 🔧 Features
-**Automatische Erkennung neuer Logeinträge** Nur neue Meldungen werden gesendet, um Spam zu vermeiden.
-**Einfache Einrichtung** Ein Bash-Installationsskript erledigt die gesamte Konfiguration.
-**Persistente Konfiguration** Der Discord Webhook wird in einer Konfigurationsdatei gespeichert.
-**Systemd-Integration** Automatischer Start des Services beim Booten.
-**Leichtgewichtig und ressourcenschonend**
## 📥 Installation
### 1⃣ Repository klonen
```bash
git clone https://github.com/dein-user/nextcloud-log-alert.git
cd nextcloud-log-alert
```
2⃣ Installationsskript ausführen
bash
Kopieren
Bearbeiten
sudo ./install.sh
Das Skript erledigt:
✅ Erstellung des notwendigen Verzeichnisses (/opt/nextcloud_log_alert)
✅ Einrichtung der Konfigurationsdatei (webhook.conf)
✅ Aktivierung des systemd-Services
3⃣ Discord Webhook hinterlegen
Während der Installation wirst du nach der Webhook-URL für Discord gefragt. Falls du sie später ändern möchtest:
bash
Kopieren
Bearbeiten
sudo nano /opt/nextcloud_log_alert/webhook.conf
4⃣ Service verwalten
Service-Status überprüfen:
bash
Kopieren
Bearbeiten
sudo systemctl status nextcloud_log_alert
Service stoppen:
bash
Kopieren
Bearbeiten
sudo systemctl stop nextcloud_log_alert
Service starten:
bash
Kopieren
Bearbeiten
sudo systemctl start nextcloud_log_alert
⚙️ Konfigurationsdateien
/opt/nextcloud_log_alert/webhook.conf Speichert die Webhook-URL.
/home/data/nextcloud.log Logdatei von Nextcloud, die überwacht wird.
🛠 Anpassungen
Falls du den Pfad der Nextcloud-Logdatei ändern möchtest, kannst du dies direkt im Python-Skript tun:
bash
Kopieren
Bearbeiten
sudo nano /opt/nextcloud_log_alert/nextcloud_log_alert.py
Ändere die Zeile:
python
Kopieren
Bearbeiten
LOG_FILE = "/home/data/nextcloud.log"
📜 Lizenz
MIT License