Cyberpower USV Appliance auf Proxmox einrichten: Unterschied zwischen den Versionen
Keine Bearbeitungszusammenfassung |
Keine Bearbeitungszusammenfassung |
||
| Zeile 15: | Zeile 15: | ||
4. Powerpanel Business starten mit http://Ip-Adresse:3052.</br> Passwort abändern | 4. Powerpanel Business starten mit http://Ip-Adresse:3052.</br> Passwort abändern | ||
5. Jetzt Schüsselpaar für den root Zugriff auf den PVE erstellen und den öffentlichen Schlüssel auf den PVE installieren</br> Alles erfolgt auf der virt. Maschine USV</br></br> ssh-keygen -t rsa</br> ssh-copy-id -i Public-Key root@PVE</br> einmal die passwortlose Verbindung test | 5. Jetzt Schüsselpaar für den root Zugriff auf den PVE erstellen und den öffentlichen Schlüssel auf den PVE installieren</br> Alles erfolgt auf der virt. Maschine USV</br></br> ssh-keygen -t rsa</br> ssh-copy-id -i Public-Key root@PVE</br></br> einmal die passwortlose Verbindung test | ||
6. Jetzt ein Shutdown Script auf dem USV erstellen und dieses unter /usr/local/PPB/extcmd ablegen. Vorlage ist vorhanden: | |||
#!/bin/sh | |||
# You can write your own commands by any *.sh | |||
# *.sh file supports Unix/Linux shell command | |||
# Available environment variable | |||
# $EVENT_STAGE when an event occurred, there are two stage for invoking commands. | |||
# When an event occurred, it enters OCCUR stage and invoking related commands. | |||
# When an event finished, it enters FINISH stage and invoking related commands. | |||
# $EVENT represents the event identification, $EVENT_CONDITION represents the condition identification. | |||
# To understand the value definition of both environment variable, please check online help or user's manual. | |||
# $MODULE_NO represents a UPS module number to help identify which module the event occur on. (PPB Local Only) | |||
if [ "$EVENT_STAGE" = "OCCUR" ]; then | |||
ssh root@192.168.196.40 'echo "Eisenring : USV hat fährt Server herunter :" | mail -s "Eisenring: Problem mit Stromversorgung" admin@kanal-eisenring.de -r admin@kanal-eisenring.de' | |||
sleep 10 | |||
ssh root@192.168.196.40 'shutdown -h now' | |||
fi | |||
if [ "$EVENT_STAGE" = "FINISH" ]; then | |||
echo | |||
fi | |||
Version vom 9. Januar 2025, 08:16 Uhr
Shutdown PVE bei Stromausfall über USV
Nachdem es keine direkte Unterstützung von Seiten Cyberpower für Proxmox gibt wird der Shutdownprozess über eine virt. Maschine auf dem PVE bewerkstellig. Auf dieser virtuelle Maschine ist die Powerpanel Software installiert und über die durchgereichte USB Schnittstelle kann diese die USV überwachen. Das Herunterfahren des PVE erfolgt über eine über passwortlose ssh Verbindung.
Vorraussetzung : Cyberpower USV ist am Server per USV angeschlossen.
1. virtuelle Maschine für USV-Anbindung anlegen und einrichten.
Die USB Schnittstelle, an der die USV per USB-Kabel angeschlossen ist an diese virt. Maschine durchreichen.
z.Bsp. Virtuelle Ubuntu 22.04 Servermaschine mit dem Namen USV
2. Download : CyberPower_PPB_Linux+64bit_v4.10.1.sh.
Diese Datei auf die virtuelle Maschine USV kopieren und das Script ausführbar machen.
3. Powerpanel Business installieren mit ./CyberPower_PPB_Linux+64bit_v4.10.1.sh
die Installation ist selbsterklärend. Option Local
4. Powerpanel Business starten mit http://Ip-Adresse:3052.
Passwort abändern
5. Jetzt Schüsselpaar für den root Zugriff auf den PVE erstellen und den öffentlichen Schlüssel auf den PVE installieren
Alles erfolgt auf der virt. Maschine USV
ssh-keygen -t rsa
ssh-copy-id -i Public-Key root@PVE
einmal die passwortlose Verbindung test
6. Jetzt ein Shutdown Script auf dem USV erstellen und dieses unter /usr/local/PPB/extcmd ablegen. Vorlage ist vorhanden:
#!/bin/sh
# You can write your own commands by any *.sh # *.sh file supports Unix/Linux shell command
# Available environment variable # $EVENT_STAGE when an event occurred, there are two stage for invoking commands. # When an event occurred, it enters OCCUR stage and invoking related commands. # When an event finished, it enters FINISH stage and invoking related commands. # $EVENT represents the event identification, $EVENT_CONDITION represents the condition identification. # To understand the value definition of both environment variable, please check online help or user's manual. # $MODULE_NO represents a UPS module number to help identify which module the event occur on. (PPB Local Only)
if [ "$EVENT_STAGE" = "OCCUR" ]; then ssh root@192.168.196.40 'echo "Eisenring : USV hat fährt Server herunter :" | mail -s "Eisenring: Problem mit Stromversorgung" admin@kanal-eisenring.de -r admin@kanal-eisenring.de' sleep 10 ssh root@192.168.196.40 'shutdown -h now' fi
if [ "$EVENT_STAGE" = "FINISH" ]; then echo
fi