Server – 服务器 UPS 从 CyberPower 更换到 APC

前言

之前使用的 UPS 是 CyberPower OLS1000E

从 2025 年 10 月开始,服务器会在每周三的 15:30 突然关机,并立刻重启,服务器日志中只有开机相关的部分而完全没有关于关机的内容。推断 UPS 会对应时刻突然切断输出,并立刻恢复导致。但是查看 UPS 日志却没有任何有关报错的信息。而后我将 UPS 设置为旁路模式,结果问题消失,由此确定为 UPS 问题。

redstone1024@myredstone-debian:~$ sudo journalctl --list-boots -r
IDX BOOT ID                          FIRST ENTRY                 LAST ENTRY                 
  0 6452dedee14c4fc893b535810ac25779 Wed 2025-10-22 18:51:49 CST Thu 2025-10-30 18:53:36 CST
 -1 a21fbae8486444b7a2f34c6354fc0ecf Wed 2025-10-22 15:32:00 CST Wed 2025-10-22 18:45:45 CST
 -2 f86a791dcb104456a915c78a60799649 Wed 2025-10-15 15:38:35 CST Wed 2025-10-22 15:28:20 CST
 -3 502c6a79302a4b02888e3f63d68d47d3 Wed 2025-10-08 15:32:55 CST Wed 2025-10-15 15:28:55 CST
 -4 e22abe8dbf924ca79923b652af02e728 Thu 2025-10-02 18:19:42 CST Wed 2025-10-08 15:29:31 CST
 -5 ff49f2f74a2c48be9f6412b3de4b6d83 Thu 2025-10-02 17:25:56 CST Thu 2025-10-02 18:15:14 CST
 -6 1431417c43574cafaf7c5b768ce19207 Thu 2025-10-02 16:14:39 CST Thu 2025-10-02 17:18:58 CST
 -7 4c564ecbdf0a4c0aa0a2ce72b8cd14ab Wed 2025-10-01 15:33:03 CST Thu 2025-10-02 16:09:08 CST
 -8 674e335233f0444da865210239596234 Wed 2025-07-16 00:11:49 CST Wed 2025-10-01 15:29:59 CST
 -9 7b783abea03d42eb983108d1bf50b335 Tue 2025-07-15 23:46:58 CST Tue 2025-07-15 23:55:43 CST
-10 1dab7080a9244ceeba7e6e6ab1e522e1 Fri 2024-07-05 21:19:23 CST Tue 2025-07-15 23:13:24 CST

于是现在决定把 UPS 换成 APC SPM1K

移除旧的 CyberPower UPS

  • 记录信息
redstone1024@myredstone-debian:~$ sudo pwrstat -status

The UPS information shows as following:

    Properties:
        Model Name................... OLS1000E
        Firmware Number.............. 6.1.6
        Rating Voltage............... 220 V
        Rating Power................. 900 Watt(1000 VA)

    Current UPS status:
        State........................ Normal
        Power Supply by.............. Utility Power
        Utility Voltage.............. 223 V
        Output Voltage............... 223 V
        Utility Frequency............ 50.0 Hz
        Output Frequency............. 50.0 Hz
        Battery Capacity............. 100 %
        Remaining Runtime............ 22 min.
        Load......................... 207 Watt(23 %)
        Test Result.................. Passed at 2025/10/22 16:04:32
        Last Power Event............. Blackout at 2025/09/03 15:31:36 for 7 sec.
redstone1024@myredstone-debian:~$ sudo journalctl -u pwrstatd -r
Oct 22 18:53:23 myredstone-debian systemd[1]: Started pwrstatd.service - The monitor UPS software..
Oct 22 18:53:23 myredstone-debian pwrstatd[1428]: Starting pwrstatd 1.4.1.
Oct 22 18:53:23 myredstone-debian systemd[1]: Starting pwrstatd.service - The monitor UPS software....
-- Boot a21fbae8486444b7a2f34c6354fc0ecf --
Oct 22 18:45:27 myredstone-debian systemd[1]: pwrstatd.service: Consumed 3.750s CPU time, 6.9M memory peak.
Oct 22 18:45:27 myredstone-debian systemd[1]: Stopped pwrstatd.service - The monitor UPS software..
Oct 22 18:45:27 myredstone-debian systemd[1]: pwrstatd.service: Deactivated successfully.
Oct 22 18:45:27 myredstone-debian pwrstatd[439355]: Stopping  pwrstatd 1.4.1.
Oct 22 18:45:27 myredstone-debian systemd[1]: Stopping pwrstatd.service - The monitor UPS software....
Oct 22 15:34:01 myredstone-debian systemd[1]: Started pwrstatd.service - The monitor UPS software..
Oct 22 15:34:01 myredstone-debian pwrstatd[1471]: Starting pwrstatd 1.4.1.
Oct 22 15:34:01 myredstone-debian systemd[1]: Starting pwrstatd.service - The monitor UPS software....
-- Boot f86a791dcb104456a915c78a60799649 --
Oct 15 15:40:24 myredstone-debian systemd[1]: Started pwrstatd.service - The monitor UPS software..
Oct 15 15:40:24 myredstone-debian pwrstatd[1482]: Starting pwrstatd 1.4.1.
Oct 15 15:40:24 myredstone-debian systemd[1]: Starting pwrstatd.service - The monitor UPS software....
-- Boot 502c6a79302a4b02888e3f63d68d47d3 --
Oct 08 15:34:49 myredstone-debian systemd[1]: Started pwrstatd.service - The monitor UPS software..
Oct 08 15:34:49 myredstone-debian pwrstatd[1497]: Starting pwrstatd 1.4.1.
Oct 08 15:34:49 myredstone-debian systemd[1]: Starting pwrstatd.service - The monitor UPS software....
-- Boot e22abe8dbf924ca79923b652af02e728 --
Oct 02 18:21:15 myredstone-debian systemd[1]: Started pwrstatd.service - The monitor UPS software..
Oct 02 18:21:15 myredstone-debian pwrstatd[1374]: Starting pwrstatd 1.4.1.
Oct 02 18:21:15 myredstone-debian systemd[1]: Starting pwrstatd.service - The monitor UPS software....
-- Boot ff49f2f74a2c48be9f6412b3de4b6d83 --
Oct 02 18:14:56 myredstone-debian systemd[1]: Stopped pwrstatd.service - The monitor UPS software..
Oct 02 18:14:56 myredstone-debian systemd[1]: pwrstatd.service: Deactivated successfully.
Oct 02 18:14:56 myredstone-debian pwrstatd[169383]: Stopping  pwrstatd 1.4.1.
Oct 02 18:14:54 myredstone-debian systemd[1]: Stopping pwrstatd.service - The monitor UPS software....
Oct 02 17:27:04 myredstone-debian systemd[1]: Started pwrstatd.service - The monitor UPS software..
Oct 02 17:27:04 myredstone-debian pwrstatd[1428]: Starting pwrstatd 1.4.1.
Oct 02 17:27:03 myredstone-debian systemd[1]: Starting pwrstatd.service - The monitor UPS software....
-- Boot 1431417c43574cafaf7c5b768ce19207 --
Oct 02 17:18:39 myredstone-debian systemd[1]: Stopped pwrstatd.service - The monitor UPS software..
Oct 02 17:18:39 myredstone-debian systemd[1]: pwrstatd.service: Deactivated successfully.
Oct 02 17:18:39 myredstone-debian pwrstatd[275866]: Stopping  pwrstatd 1.4.1.
Oct 02 17:18:39 myredstone-debian systemd[1]: Stopping pwrstatd.service - The monitor UPS software....
Oct 02 16:15:46 myredstone-debian systemd[1]: Started pwrstatd.service - The monitor UPS software..
Oct 02 16:15:46 myredstone-debian pwrstatd[1347]: Starting pwrstatd 1.4.1.
Oct 02 16:15:46 myredstone-debian systemd[1]: Starting pwrstatd.service - The monitor UPS software....
-- Boot 4c564ecbdf0a4c0aa0a2ce72b8cd14ab --
Oct 02 16:08:31 myredstone-debian systemd[1]: pwrstatd.service: Consumed 26.188s CPU time.
Oct 02 16:08:31 myredstone-debian systemd[1]: Stopped pwrstatd.service - The monitor UPS software..
Oct 02 16:08:31 myredstone-debian systemd[1]: pwrstatd.service: Deactivated successfully.
Oct 02 16:08:30 myredstone-debian pwrstatd[2720528]: Stopping  pwrstatd 1.4.1.
Oct 02 16:08:30 myredstone-debian systemd[1]: Stopping pwrstatd.service - The monitor UPS software....
Oct 01 15:34:29 myredstone-debian systemd[1]: Started pwrstatd.service - The monitor UPS software..
Oct 01 15:34:29 myredstone-debian pwrstatd[1399]: Starting pwrstatd 1.4.1.
Oct 01 15:34:29 myredstone-debian systemd[1]: Starting pwrstatd.service - The monitor UPS software....
-- Boot 674e335233f0444da865210239596234 --
Jul 16 00:12:54 myredstone-debian systemd[1]: Started pwrstatd.service - The monitor UPS software..
Jul 16 00:12:54 myredstone-debian pwrstatd[1254]: Starting pwrstatd 1.4.1.
Jul 16 00:12:54 myredstone-debian systemd[1]: Starting pwrstatd.service - The monitor UPS software....
-- Boot 7b783abea03d42eb983108d1bf50b335 --
  • 拆卸驱动
redstone1024@myredstone-debian:~$ sudo -i command -v pwrstat
/usr/sbin/pwrstat
redstone1024@myredstone-debian:~$ sudo dpkg -S /usr/sbin/pwrstat
powerpanel: /usr/sbin/pwrstat
redstone1024@myredstone-debian:~$ sudo apt-get purge -y powerpanel
  • 服务器常规关机
  • 移除 CyberPower UPS

安装新的 APC UPS

  • 安装 APC UPS

  • 通过 USB 连接服务器和 UPS

  • 服务器常规开机

  • 安装驱动

redstone1024@myredstone-debian:~$ sudo apt-get update
redstone1024@myredstone-debian:~$ sudo apt-get install apcupsd
  • 修改驱动设置为 USB 串口连接
redstone1024@myredstone-debian:~$ sudo vim /etc/apcupsd/apcupsd.conf
...
UPSCABLE smart
UPSTYPE apcsmart
DEVICE /dev/ttyUSB0
...

发表回复