Added Wiki for Linux Proxmox and div. Software-installs
This commit is contained in:
parent
d47f1dc602
commit
741584446c
17 changed files with 4537 additions and 0 deletions
85
Proxmox/Notification/Email-Konfigurieren.md
Normal file
85
Proxmox/Notification/Email-Konfigurieren.md
Normal file
|
@ -0,0 +1,85 @@
|
|||
# Emails Konfigurieren
|
||||
|
||||
## Konfigurieren der Benutzer-E-Mail-Adresse
|
||||
|
||||
- Navigieren Sie in einem Webbrowser zur Proxmox Web UI und melden Sie sich an
|
||||
- Wählen Sie Datacenter > Permissions > Users aus dem linken Navigationsmenü
|
||||
- Doppelklicken Sie auf den zu konfigurierenden Benutzer
|
||||
- Füllen Sie das Feld "E-Mail" im Formular "Benutzer bearbeiten" aus > Klicken Sie auf "OK".
|
||||
|
||||
## Einfache Konfiguration über Web UI
|
||||
|
||||
Standardmäßig versucht Proxmox, den Domänenanteil der "E-Mail von-Adresse" als E-Mail-Relay-Server zu verwenden.
|
||||
|
||||
- Wählen Sie in den linken Navigationsmenüs Datacenter > Options
|
||||
- Doppelklicken Sie auf das Feld E-Mail von Adresse
|
||||
- Geben Sie die E-Mail-Adresse ein, von der Proxmox ausgehende E-Mails senden soll > Klicken Sie auf OK
|
||||
- Erweitern Sie Datacenter > Wählen Sie den Knotennamen aus > Klicken Sie in den linken Navigationsmenüs auf Shell
|
||||
- Führen Sie die folgenden Befehle im Terminal aus
|
||||
|
||||
```
|
||||
# send a basic test email
|
||||
echo "Test email from Proxmox: $(hostname)" | /usr/bin/proxmox-mail-forward
|
||||
# output the mail log
|
||||
cat /var/log/mail.log
|
||||
```
|
||||
|
||||
- Beachten Sie, dass das Relais die Domäne (i12bretro.local) aus der Einstellung "E-Mail von" ist.
|
||||
|
||||
## Erweiterte Konfiguration über CLI
|
||||
|
||||
Um erweiterte Konfigurationsänderungen vorzunehmen, wie z. B. die Verwendung eines Gmail-Kontos, müssen Sie die Postfix-Einstellungen über die Kommandozeile bearbeiten
|
||||
|
||||
- Zurück in der Proxmox-Web-Shell, führen Sie die folgenden Befehle im Terminal aus
|
||||
|
||||
```
|
||||
# install libsasl
|
||||
apt install libsasl2-modules -y
|
||||
# edit the postfix config
|
||||
nano /etc/postfix/main.cf
|
||||
```
|
||||
|
||||
- Drücken Sie CTRL+W und suchen Sie nach mydestination
|
||||
- Kommentieren Sie mydestination aus, indem Sie ein # an den Anfang der Zeile setzen
|
||||
- Drücken Sie CTRL+W und suchen Sie nach relayhost
|
||||
- Kommentieren Sie relayhost aus, indem Sie ein # an den Anfang der Zeile setzen
|
||||
- Aktualisieren oder fügen Sie die folgende Konfiguration hinzu
|
||||
|
||||
```
|
||||
relayhost = smtp.gmail.com:587
|
||||
smtp_use_tls = yes
|
||||
smtp_sasl_auth_enable = yes
|
||||
smtp_sasl_security_options =
|
||||
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
|
||||
smtp_tls_CAfile = /etc/ssl/certs/Entrust_Root_Certification_Authority.pem
|
||||
```
|
||||
|
||||
- Drücken Sie CTRL+O, Enter, CTRL+X, um die Änderungen zu übernehmen.
|
||||
- Fahren Sie mit den folgenden Befehlen im Terminal fort
|
||||
|
||||
```
|
||||
# create /etc/postfix/sasl_passwd
|
||||
nano /etc/postfix/sasl_passwd
|
||||
```
|
||||
|
||||
- Fügen Sie eine Zeile zur Konfiguration der Google Mail-Authentifizierung hinzu
|
||||
|
||||
```
|
||||
smtp.gmail.com:587 <%youraccount%>@gmail.com:<%yourpassword%>
|
||||
```
|
||||
|
||||
- Drücken Sie CTRL+O, Enter, CTRL+X, um die Änderungen zu übernehmen
|
||||
- Fahren Sie mit den folgenden Befehlen im Terminal fort
|
||||
|
||||
```
|
||||
# update postfix lookup tables
|
||||
postmap hash:/etc/postfix/sasl_passwd
|
||||
# limit access to sasl_passwd to only root
|
||||
chmod 600 /etc/postfix/sasl_passwd
|
||||
# restart postfix service
|
||||
systemctl restart postfix
|
||||
# test from postfix directly
|
||||
echo "Test email from Proxmox: $(hostname)" | mail -s "Proxmox Testing" <%youraccount%>@gmail.com
|
||||
# send a test from proxmox
|
||||
echo "Test email from Proxmox: $(hostname)" | /usr/bin/proxmox-mail-forward
|
||||
```
|
53
Proxmox/Notification/ZFS-Alarm.md
Normal file
53
Proxmox/Notification/ZFS-Alarm.md
Normal 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.
|
Loading…
Add table
Add a link
Reference in a new issue