Added Wiki for Linux Proxmox and div. Software-installs

This commit is contained in:
ZennDev1337 2023-12-21 13:00:56 +01:00
parent d47f1dc602
commit 741584446c
17 changed files with 4537 additions and 0 deletions

View file

@ -0,0 +1,53 @@
# ZFS Alarm
[Richte zuerst dein Proxmox ein um Emails zu senden.](/Linux/Proxmox/Notification/konfigurieren)
## Erstelle ein neues Script
```
#!/bin/bash
# pool to check
POOLS=("Name-deines-Tanks" "Name-deines-Tanks2" "Name-deines-Tanks3")
# needed paths
LOGFILE="/var/log/poolStatusCheck.log"
ZFS="/sbin/zfs"
for POOL in ${POOLS[@]}; do
if [ "$(zpool status $POOL -x)" != "pool '$POOL' is healthy" ]; then
echo "$(date) - Alarm - zPool $POOL is not healthy" >> $LOGFILE
echo $'From: Proxmox <EMAIL DIE DU EINGERICHTET HAST>\nSubject: ZFS ALARM\n'$(date)' - Alarm - zPool '$POOL' is not healthy' | proxmox-mail-forward
fi
done
```
Bearbeite das Script.
Ändere die Poolnamen\
Ändere die From Email. Die From Email muss die gleiche sein wie die in deiner SMTP Einstellung, oder die deines Root Accounts.\
Wichtig: Die <> Klammern braucht es.
## Autorun Cronjob
Mit Cronjobs kannst du commands automatisch starten.
> Arbeite in der Root shell
Gib dafür `crontab -e` in deiner Konsole ein.
Auf der Website [cron.help](https://cron.help/) kannst du ein Pattern erstellen.
```
*/10 * * * * *
```
Dieses Pattern wird dafür sorgen, dass das Script alle 10 Minuten ausgeführt wird.
In der Konsole sollte jetzt Crontab offen sein und da kannst du ganz unten nun die folgende Zeile einfügen:
```
*/10 * * * * /PFAD/ZU/DEINEM/SCRIPT.sh
```
Fertig.