原创文章,转载请注明出处
https://qiedd.com/
0. 前言
BK650M2-CH 这块中国特供版的 UPS 在使用 apcupsd 时会出现异常情况, 即使是接入市电, 它的状态会一直维持在 STATUS : ONBATT, 因此会导致异常关机, 所以我决定在 PVE 上使用 NUT

1. 使用
# 安装 nut apt update -y && apt install nut # 扫描 UPS 设备 nut-scanner

# 简单配置 vim /etc/nut/ups.conf ## 修改 upsname 以及注释 maxretry


# nut 驱动启动 systemctl start nut-driver-enumerator.service && systemctl enable nut-driver-enumerator.service # 配置用户文件 /etc/nut/upsd.users ## 在最下方加入 [upsuser] password = password upsmon primary actions = SET instcmds = ALL # 设置 nut 模式 vim /etc/nut/nut.conf ## 修改为 MODE=standalone # 启动 nut-server systemctl start nut-server.service && systemctl enable nut-server.service # 查看配置 upsc upsname
输出

设置断电关机
# 设置 upscom vim /etc/nut/upsmon.conf ## 找到 MONITOR 添加 MONITOR upsname@localhost 1 upsduser password primary ## 一些选项 DEADTIME: UPS 掉线阈值, 默认 15s FINALDELAY: 等待多久后, shutdown 宿主机 ## 启动 monitor systemctl start nut-monitor.service && systemctl enable nut-monitor.service ## 启动 nut systemctl start nut.target && systemctl enable nut.target && systemctl enable nut-driver.target && systemctl start nut-driver.target
0 条评论