ubuntu:ups
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
| ubuntu:ups [2026/07/19 12:16] – franz | ubuntu:ups [2026/08/25 11:35] (aktuell) – [Voraussetzungen] franz | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | ====== | + | ====== |
| - | ====== | + | |
| ===== Ziel ===== | ===== Ziel ===== | ||
| Zeile 29: | Zeile 29: | ||
| * Root- oder sudo-Berechtigung | * Root- oder sudo-Berechtigung | ||
| - | Beispiel-IP des NUT-Masters: | + | Beispiel-IP des NUT-Masters: |
| - | < | + | Diese Adresse muss durch die tatsächliche IP-Adresse des Servers ersetzt werden. |
| - | 192.168.1.20 | + | |
| - | </ | ||
| - | |||
| - | Diese Adresse muss durch die tatsächliche IP-Adresse des Servers ersetzt werden. | ||
| ===== 1. USB-Verbindung prüfen ===== | ===== 1. USB-Verbindung prüfen ===== | ||
| Zeile 46: | Zeile 42: | ||
| <code bash> | <code bash> | ||
| lsusb | grep -i -E ' | lsusb | grep -i -E ' | ||
| - | |||
| </ | </ | ||
| Zeile 60: | Zeile 55: | ||
| Die Kennung '' | Die Kennung '' | ||
| + | |||
| ===== 2. NUT installieren ===== | ===== 2. NUT installieren ===== | ||
| Zeile 66: | Zeile 62: | ||
| <code bash> | <code bash> | ||
| sudo apt \update | sudo apt \update | ||
| - | |||
| </ | </ | ||
| Zeile 74: | Zeile 69: | ||
| <code bash> | <code bash> | ||
| sudo apt install nut-server nut-\client | sudo apt install nut-server nut-\client | ||
| - | |||
| </ | </ | ||
| Zeile 82: | Zeile 76: | ||
| <code bash> | <code bash> | ||
| apt-cache policy nut-\server | apt-cache policy nut-\server | ||
| - | |||
| </ | </ | ||
| Zeile 92: | Zeile 85: | ||
| <code bash> | <code bash> | ||
| sudo cp -a /etc/nut "/ | sudo cp -a /etc/nut "/ | ||
| - | |||
| </ | </ | ||
| Zeile 106: | Zeile 98: | ||
| Die Datei ''/ | Die Datei ''/ | ||
| + | |||
| <code bash> | <code bash> | ||
| sudo nano / | sudo nano / | ||
| - | |||
| </ | </ | ||
| Zeile 116: | Zeile 108: | ||
| <code ini> | <code ini> | ||
| MODE=\netserver | MODE=\netserver | ||
| - | |||
| </ | </ | ||
| - | < | + | < |
| + | Bei '' | ||
| - | Zusätzlich können andere Server im Netzwerk auf die USV-Informationen zugreifen. </ | + | Zusätzlich können andere Server im Netzwerk auf die USV-Informationen zugreifen. |
| + | </ | ||
| Beim Eintrag dürfen um das Gleichheitszeichen keine Leerzeichen stehen. | Beim Eintrag dürfen um das Gleichheitszeichen keine Leerzeichen stehen. | ||
| Zeile 130: | Zeile 123: | ||
| <code ini> | <code ini> | ||
| MODE=\netserver | MODE=\netserver | ||
| - | |||
| </ | </ | ||
| Zeile 138: | Zeile 130: | ||
| <code ini> | <code ini> | ||
| MODE = \netserver | MODE = \netserver | ||
| - | |||
| </ | </ | ||
| Zeile 145: | Zeile 136: | ||
| Die Datei ''/ | Die Datei ''/ | ||
| + | |||
| <code bash> | <code bash> | ||
| sudo nano / | sudo nano / | ||
| - | |||
| </ | </ | ||
| Zeile 159: | Zeile 150: | ||
| vendorid = \051d | vendorid = \051d | ||
| desc = "APC Smart-UPS SMC1500IC" | desc = "APC Smart-UPS SMC1500IC" | ||
| - | |||
| </ | </ | ||
| Zeile 165: | Zeile 155: | ||
| Bedeutung der Einstellungen: | Bedeutung der Einstellungen: | ||
| - | ^Einstellung^Bedeutung| | | | | | | | | | | | | | + | ^ Einstellung ^ Bedeutung |
| - | |'' | + | | '' |
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| Wenn mehrere APC-USV-Geräte am selben Server angeschlossen sind, kann zusätzlich die Produkt-ID angegeben werden: | Wenn mehrere APC-USV-Geräte am selben Server angeschlossen sind, kann zusätzlich die Produkt-ID angegeben werden: | ||
| - | <code ini> | + | <code ini>\\ |
| - | productid = 0003\ | + | productid = 0003\\ |
| </ | </ | ||
| Zeile 185: | Zeile 178: | ||
| productid = \0003 | productid = \0003 | ||
| desc = "APC Smart-UPS SMC1500IC" | desc = "APC Smart-UPS SMC1500IC" | ||
| - | |||
| </ | </ | ||
| Zeile 195: | Zeile 187: | ||
| <code bash> | <code bash> | ||
| ip -br \address | ip -br \address | ||
| - | |||
| </ | </ | ||
| Zeile 224: | Zeile 215: | ||
| Die Datei ''/ | Die Datei ''/ | ||
| + | |||
| <code bash> | <code bash> | ||
| sudo nano / | sudo nano / | ||
| - | |||
| </ | </ | ||
| Zeile 235: | Zeile 226: | ||
| LISTEN 127.0.0.1 \3493 | LISTEN 127.0.0.1 \3493 | ||
| LISTEN 192.168.1.20 \3493 | LISTEN 192.168.1.20 \3493 | ||
| - | |||
| </ | </ | ||
| Zeile 252: | Zeile 242: | ||
| <code ini> | <code ini> | ||
| LISTEN 127.0.0.1 \3493 | LISTEN 127.0.0.1 \3493 | ||
| - | |||
| </ | </ | ||
| Zeile 260: | Zeile 249: | ||
| <code ini> | <code ini> | ||
| LISTEN 192.168.1.20 \3493 | LISTEN 192.168.1.20 \3493 | ||
| - | |||
| </ | </ | ||
| Zeile 272: | Zeile 260: | ||
| <code bash> | <code bash> | ||
| openssl rand -hex \24 | openssl rand -hex \24 | ||
| - | |||
| </ | </ | ||
| Zeile 279: | Zeile 266: | ||
| Die Datei ''/ | Die Datei ''/ | ||
| + | |||
| <code bash> | <code bash> | ||
| sudo nano / | sudo nano / | ||
| - | |||
| </ | </ | ||
| Zeile 295: | Zeile 282: | ||
| password = \CLIENT_PASSWORT_HIER_EINTRAGEN | password = \CLIENT_PASSWORT_HIER_EINTRAGEN | ||
| upsmon \slave | upsmon \slave | ||
| - | |||
| </ | </ | ||
| Zeile 309: | Zeile 295: | ||
| password = \CLIENT_PASSWORT_HIER_EINTRAGEN | password = \CLIENT_PASSWORT_HIER_EINTRAGEN | ||
| upsmon \secondary | upsmon \secondary | ||
| - | |||
| </ | </ | ||
| - | <note warning> Die Platzhalter müssen durch echte Passwörter ersetzt werden. | + | <note warning> |
| + | Die Platzhalter müssen durch echte Passwörter ersetzt werden. | ||
| - | Die Passwörter sollten nicht in einer öffentlich zugänglichen Dokumentation gespeichert werden. </ | + | Die Passwörter sollten nicht in einer öffentlich zugänglichen Dokumentation gespeichert werden. |
| + | </ | ||
| ===== 9. Lokalen NUT-Monitor konfigurieren ===== | ===== 9. Lokalen NUT-Monitor konfigurieren ===== | ||
| Die Datei ''/ | Die Datei ''/ | ||
| + | |||
| <code bash> | <code bash> | ||
| sudo nano / | sudo nano / | ||
| - | |||
| </ | </ | ||
| Vorhandene aktive '' | Vorhandene aktive '' | ||
| + | |||
| ==== Ubuntu 22.04 beziehungsweise NUT 2.7 ==== | ==== Ubuntu 22.04 beziehungsweise NUT 2.7 ==== | ||
| <code ini> | <code ini> | ||
| MONITOR apc@localhost 1 monmaster MASTER_PASSWORT_HIER_EINTRAGEN master | MONITOR apc@localhost 1 monmaster MASTER_PASSWORT_HIER_EINTRAGEN master | ||
| - | |||
| MINSUPPLIES 1 | MINSUPPLIES 1 | ||
| - | |||
| SHUTDOWNCMD "/ | SHUTDOWNCMD "/ | ||
| - | |||
| POWERDOWNFLAG / | POWERDOWNFLAG / | ||
| </ | </ | ||
| + | |||
| ==== Ubuntu 24.04 beziehungsweise NUT 2.8 ==== | ==== Ubuntu 24.04 beziehungsweise NUT 2.8 ==== | ||
| Zeile 351: | Zeile 337: | ||
| POWERDOWNFLAG / | POWERDOWNFLAG / | ||
| - | |||
| </ | </ | ||
| Zeile 359: | Zeile 344: | ||
| Bedeutung der wichtigsten Einträge: | Bedeutung der wichtigsten Einträge: | ||
| - | ^Einstellung^Bedeutung| | | | | | | | | | | | | | | | | | | | + | ^ Einstellung ^ Bedeutung |
| - | |'' | + | | '' |
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| ===== 10. Dateirechte absichern ===== | ===== 10. Dateirechte absichern ===== | ||
| Die Konfigurationsdateien enthalten Passwörter und sollten nur für root und die Gruppe '' | Die Konfigurationsdateien enthalten Passwörter und sollten nur für root und die Gruppe '' | ||
| - | <code bash> | ||
| - | sudo chown root:nut / | ||
| + | <code bash>\\ | ||
| + | sudo chown root:nut / | ||
| </ | </ | ||
| Zeile 373: | Zeile 364: | ||
| <code bash> | <code bash> | ||
| sudo chmod 640 / | sudo chmod 640 / | ||
| - | |||
| </ | </ | ||
| Zeile 381: | Zeile 371: | ||
| <code bash> | <code bash> | ||
| ls -l / | ls -l / | ||
| - | |||
| </ | </ | ||
| Zeile 401: | Zeile 390: | ||
| <code bash> | <code bash> | ||
| sudo systemctl enable nut-server nut-\monitor | sudo systemctl enable nut-server nut-\monitor | ||
| - | |||
| </ | </ | ||
| Zeile 409: | Zeile 397: | ||
| <code bash> | <code bash> | ||
| sudo systemctl restart nut-\server | sudo systemctl restart nut-\server | ||
| - | |||
| </ | </ | ||
| Zeile 417: | Zeile 404: | ||
| <code bash> | <code bash> | ||
| sudo systemctl restart nut-\monitor | sudo systemctl restart nut-\monitor | ||
| - | |||
| </ | </ | ||
| Zeile 425: | Zeile 411: | ||
| <code bash> | <code bash> | ||
| systemctl --no-pager --full status nut-server nut-\monitor | systemctl --no-pager --full status nut-server nut-\monitor | ||
| - | |||
| </ | </ | ||
| Zeile 435: | Zeile 420: | ||
| <code bash> | <code bash> | ||
| sudo systemctl restart nut-driver-enumerator.\service | sudo systemctl restart nut-driver-enumerator.\service | ||
| - | |||
| </ | </ | ||
| Zeile 441: | Zeile 425: | ||
| <code bash> | <code bash> | ||
| sudo systemctl restart nut-server.\service | sudo systemctl restart nut-server.\service | ||
| - | |||
| </ | </ | ||
| Zeile 447: | Zeile 430: | ||
| <code bash> | <code bash> | ||
| sudo systemctl restart nut-monitor.\service | sudo systemctl restart nut-monitor.\service | ||
| - | |||
| </ | </ | ||
| Zeile 455: | Zeile 437: | ||
| <code bash> | <code bash> | ||
| systemctl --no-pager --full status nut-driver-enumerator.service nut-server.service nut-monitor.\service | systemctl --no-pager --full status nut-driver-enumerator.service nut-server.service nut-monitor.\service | ||
| - | |||
| </ | </ | ||
| Zeile 504: | Zeile 485: | ||
| < | < | ||
| - | \OL | + | OL |
| </ | </ | ||
| Zeile 526: | Zeile 507: | ||
| * Netzversorgung \vorhanden * Batterie wird geladen | * Netzversorgung \vorhanden * Batterie wird geladen | ||
| + | |||
| ===== 13. Netzwerkzugriff mit UFW erlauben ===== | ===== 13. Netzwerkzugriff mit UFW erlauben ===== | ||
| Zeile 532: | Zeile 514: | ||
| Beispiel für das Netzwerk '' | Beispiel für das Netzwerk '' | ||
| + | |||
| <code bash> | <code bash> | ||
| sudo ufw allow from 192.168.1.0/ | sudo ufw allow from 192.168.1.0/ | ||
| - | |||
| </ | </ | ||
| Zeile 542: | Zeile 524: | ||
| <code bash> | <code bash> | ||
| sudo ufw \status | sudo ufw \status | ||
| - | |||
| </ | </ | ||
| Zeile 550: | Zeile 531: | ||
| <code bash> | <code bash> | ||
| sudo ss -ltnp | grep \3493 | sudo ss -ltnp | grep \3493 | ||
| - | |||
| </ | </ | ||
| Zeile 568: | Zeile 548: | ||
| <code bash> | <code bash> | ||
| sudo apt \update | sudo apt \update | ||
| - | |||
| </ | </ | ||
| Zeile 574: | Zeile 553: | ||
| <code bash> | <code bash> | ||
| sudo apt install nut-\client | sudo apt install nut-\client | ||
| - | |||
| </ | </ | ||
| Zeile 582: | Zeile 560: | ||
| <code bash> | <code bash> | ||
| upsc apc@192.168.1.\20 | upsc apc@192.168.1.\20 | ||
| - | |||
| </ | </ | ||
| Zeile 597: | Zeile 574: | ||
| sollten folgende Punkte kontrolliert werden: | sollten folgende Punkte kontrolliert werden: | ||
| - | * Ist '' | + | * Ist '' |
| + | * Ist die richtige IP in '' | ||
| + | * Ist TCP-Port 3493 durch die Firewall freigegeben? | ||
| + | * Ist die IP-Adresse vom Client erreichbar? | ||
| ===== 15. Vorsichtiger Stromausfalltest ===== | ===== 15. Vorsichtiger Stromausfalltest ===== | ||
| Zeile 606: | Zeile 587: | ||
| <code bash> | <code bash> | ||
| watch -n 2 'upsc apc@localhost ups.status; upsc apc@localhost battery.charge; | watch -n 2 'upsc apc@localhost ups.status; upsc apc@localhost battery.charge; | ||
| - | |||
| </ | </ | ||
| Zeile 614: | Zeile 594: | ||
| Dabei sollten folgende Änderungen sichtbar sein: | Dabei sollten folgende Änderungen sichtbar sein: | ||
| - | ^Zustand^Erwarteter Status| | | | | | | | + | ^ Zustand ^ Erwarteter Status |
| - | |Netzstrom vorhanden|'' | + | | Netzstrom vorhanden | '' |
| + | | Netzstrom getrennt | '' | ||
| + | | Netzstrom wiederhergestellt | '' | ||
| Die angeschlossenen Server müssen während des kurzen Tests weiterlaufen. | Die angeschlossenen Server müssen während des kurzen Tests weiterlaufen. | ||
| Zeile 630: | Zeile 612: | ||
| <code bash> | <code bash> | ||
| - | \ | + | upsdrvctl shutdown |
| - | upsdrvctl shutdown\ | + | |
| Zeile 639: | Zeile 620: | ||
| Dadurch verlieren alle an der USV angeschlossenen Geräte unmittelbar ihre Stromversorgung. | Dadurch verlieren alle an der USV angeschlossenen Geräte unmittelbar ihre Stromversorgung. | ||
| + | |||
| ===== 17. Fehlerdiagnose ===== | ===== 17. Fehlerdiagnose ===== | ||
| Zeile 653: | Zeile 635: | ||
| <code bash> | <code bash> | ||
| - | \lsusb | + | lsusb |
| Zeile 681: | Zeile 663: | ||
| </ | </ | ||
| + | |||
| ==== Fehler: Driver failed to start ==== | ==== Fehler: Driver failed to start ==== | ||
| Zeile 688: | Zeile 671: | ||
| <code bash> | <code bash> | ||
| sudo upsdrvctl \stop | sudo upsdrvctl \stop | ||
| - | |||
| </ | </ | ||
| Zeile 696: | Zeile 678: | ||
| <code bash> | <code bash> | ||
| sudo / | sudo / | ||
| - | |||
| </ | </ | ||
| Zeile 706: | Zeile 687: | ||
| <code bash> | <code bash> | ||
| sudo systemctl restart nut-\server | sudo systemctl restart nut-\server | ||
| - | |||
| </ | </ | ||
| Zeile 716: | Zeile 696: | ||
| <code bash> | <code bash> | ||
| ps aux | grep -E ' | ps aux | grep -E ' | ||
| - | |||
| </ | </ | ||
| Zeile 726: | Zeile 705: | ||
| <code bash> | <code bash> | ||
| systemctl status \apcupsd | systemctl status \apcupsd | ||
| - | |||
| </ | </ | ||
| Falls NUT verwendet werden soll, '' | Falls NUT verwendet werden soll, '' | ||
| + | |||
| <code bash> | <code bash> | ||
| sudo systemctl disable --now \apcupsd | sudo systemctl disable --now \apcupsd | ||
| - | |||
| </ | </ | ||
| Zeile 741: | Zeile 719: | ||
| <code bash> | <code bash> | ||
| sudo systemctl restart nut-server nut-\monitor | sudo systemctl restart nut-server nut-\monitor | ||
| - | |||
| </ | </ | ||
| Zeile 751: | Zeile 728: | ||
| <code bash> | <code bash> | ||
| sudo systemctl status nut-server --no-\pager | sudo systemctl status nut-server --no-\pager | ||
| - | |||
| </ | </ | ||
| Zeile 759: | Zeile 735: | ||
| <code bash> | <code bash> | ||
| sudo journalctl -u nut-server -n 100 --no-\pager | sudo journalctl -u nut-server -n 100 --no-\pager | ||
| - | |||
| </ | </ | ||
| Zeile 767: | Zeile 742: | ||
| <code bash> | <code bash> | ||
| lsusb | grep -i -E ' | lsusb | grep -i -E ' | ||
| - | |||
| </ | </ | ||
| Zeile 775: | Zeile 749: | ||
| ===== 18. Konfigurationsdateien im Überblick ===== | ===== 18. Konfigurationsdateien im Überblick ===== | ||
| - | ^Datei^Aufgabe| | | | | | | | | | | | | | + | ^ Datei ^ Aufgabe |
| - | |''/ | + | | ''/ |
| + | | ''/ | ||
| + | | ''/ | ||
| + | | ''/ | ||
| + | | ''/ | ||
| ===== 19. Beispiel einer vollständigen Konfiguration ===== | ===== 19. Beispiel einer vollständigen Konfiguration ===== | ||
| Zeile 783: | Zeile 761: | ||
| <code ini> | <code ini> | ||
| - | \ | + | MODE=netserver |
| - | MODE=netserver\ | + | |
| </ | </ | ||
| + | |||
| ==== / | ==== / | ||
| <code ini> | <code ini> | ||
| - | \ | + | [apc] |
| - | [apc]\ | + | driver = usbhid-ups |
| - | driver = usbhid-ups\ | + | port = auto |
| - | port = auto\ | + | vendorid = 051d |
| - | vendorid = 051d\ | + | desc = "APC Smart-UPS SMC1500IC" |
| - | desc = "APC Smart-UPS SMC1500IC" | + | |
| </ | </ | ||
| + | |||
| ==== / | ==== / | ||
| <code ini> | <code ini> | ||
| - | \ | ||
| LISTEN 127.0.0.1 3493\ | LISTEN 127.0.0.1 3493\ | ||
| LISTEN 192.168.1.20 3493\ | LISTEN 192.168.1.20 3493\ | ||
| Zeile 811: | Zeile 788: | ||
| </ | </ | ||
| + | |||
| ==== / | ==== / | ||
| <code ini> | <code ini> | ||
| - | \ | + | [monmaster] |
| - | [monmaster]\ | + | |
| password = MASTER_PASSWORT_HIER_EINTRAGEN\ | password = MASTER_PASSWORT_HIER_EINTRAGEN\ | ||
| upsmon master | upsmon master | ||
| - | [monclient]\ | + | [monclient] |
| password = CLIENT_PASSWORT_HIER_EINTRAGEN\ | password = CLIENT_PASSWORT_HIER_EINTRAGEN\ | ||
| - | upsmon slave\ | + | upsmon slave |
| </ | </ | ||
| + | |||
| ==== / | ==== / | ||
| <code ini> | <code ini> | ||
| - | \ | ||
| MONITOR apc@localhost 1 monmaster MASTER_PASSWORT_HIER_EINTRAGEN master | MONITOR apc@localhost 1 monmaster MASTER_PASSWORT_HIER_EINTRAGEN master | ||
| - | |||
| MINSUPPLIES 1 | MINSUPPLIES 1 | ||
| - | |||
| SHUTDOWNCMD "/ | SHUTDOWNCMD "/ | ||
| + | POWERDOWNFLAG / | ||
| - | POWERDOWNFLAG / | ||
| + | </ | ||
| - | </ | ||
| ===== Ergebnis ===== | ===== Ergebnis ===== | ||
| Zeile 847: | Zeile 822: | ||
| <code bash> | <code bash> | ||
| - | \ | + | upsc apc@localhost |
| - | upsc apc@localhost\ | + | |
| Zeile 854: | Zeile 828: | ||
| Bei normaler Netzversorgung sollte unter anderem folgender Status erscheinen: | Bei normaler Netzversorgung sollte unter anderem folgender Status erscheinen: | ||
| + | |||
| < | < | ||
| - | + | ups.status: OL | |
| - | \ | + | |
| - | ups.status: OL\ | + | |
| </ | </ | ||
ubuntu/ups.1784456183.txt.gz · Zuletzt geändert: von franz