nut 客户端配置问题

nut 客户端配置问题

我的机架中运行着 2 台 UPS NUT 服务器。1 台在 TrueNAS SCALE 上运行,另一台在 Synology DS918+ 上运行。还有一个 NUT 客户端在 ubuntu 服务器上运行。

NUT 客户端不断抱怨:

Broadcast message from nut@nuc13 (somewhere) (Sat Jan 27 16:16:52 2024):       
                                                                               
UPS [email protected] is unavailable                                     
                                                                               
                                                                               
Broadcast message from nut@nuc13 (somewhere) (Sat Jan 27 16:16:52 2024):       
                                                                               
UPS [email protected] is unavailable                                                                                                             

有人能帮我修复它吗?

以下是删除注释后的 upsmon.conf 内容:

MONITOR [email protected] 1 [username] [password] secondary
MONITOR [email protected] 0 [username] [password] secondary

MINSUPPLIES 1

SHUTDOWNCMD "/sbin/shutdown -h +0"

POLLFREQ 5

POLLFREQALERT 5

HOSTSYNC 15

DEADTIME 15

POWERDOWNFLAG /etc/killpower

RBWARNTIME 43200

NOCOMMWARNTIME 300

FINALDELAY 5

使用 telnet 似乎可以工作。以下是从 ubuntu 服务器连接到 DS918+ 的示例(基于 IP 的身份验证。无需登录):

$ telnet 10.27.0.40 3493
Trying 10.27.0.40...
Connected to 10.27.0.40.
Escape character is '^]'.
LIST UPS
BEGIN LIST UPS
UPS ups "Description unavailable"
END LIST UPS
LIST VAR ups
BEGIN LIST VAR ups
VAR ups battery.charge "100"
VAR ups battery.charge.low "10"
VAR ups battery.charge.warning "50"
VAR ups battery.date "2001/09/25"
VAR ups battery.mfr.date "2020/10/04"
VAR ups battery.runtime "1316"
VAR ups battery.runtime.low "120"
VAR ups battery.type "PbAc"
VAR ups battery.voltage "13.6"
VAR ups battery.voltage.nominal "12.0"
VAR ups device.mfr "American Power Conversion"
VAR ups device.model "Back-UPS ES 850G2"
VAR ups device.serial "5B2040T68465  "
VAR ups device.type "ups"
VAR ups driver.name "usbhid-ups"
VAR ups driver.parameter.pollfreq "30"
VAR ups driver.parameter.pollinterval "5"
VAR ups driver.parameter.port "auto"
VAR ups driver.parameter.synchronous "no"
VAR ups driver.version "DSM7-2-60108-221130"
VAR ups driver.version.data "APC HID 0.96"
VAR ups driver.version.internal "0.41"
VAR ups input.sensitivity "medium"
VAR ups input.transfer.high "266"
VAR ups input.transfer.low "180"
VAR ups input.voltage "241.0"
VAR ups input.voltage.nominal "230"
VAR ups ups.beeper.status "enabled"
VAR ups ups.delay.shutdown "20"
VAR ups ups.firmware "938.a2 .I"
VAR ups ups.firmware.aux "a"
VAR ups ups.load "22"
VAR ups ups.mfr "American Power Conversion"
VAR ups ups.mfr.date "2020/10/04"
VAR ups ups.model "Back-UPS ES 850G2"
VAR ups ups.productid "0002"
VAR ups ups.realpower.nominal "520"
VAR ups ups.serial "5B2040T68465  "
VAR ups ups.status "OL"
VAR ups ups.test.result "No test initiated"
VAR ups ups.timer.reboot "0"
VAR ups ups.timer.shutdown "-1"
VAR ups ups.vendorid "051d"
END LIST VAR ups
^]
telnet> quit
Connection closed.

并且从 ubuntu 连接到 TrueNAS 也没有问题:

$ telnet 10.27.0.61 3493
Trying 10.27.0.61...
Connected to 10.27.0.61.
Escape character is '^]'.
USERNAME [username]
OK
PASSWORD [password]
OK
LIST UPS
BEGIN LIST UPS
UPS APC_ES850_G2-new "APC Back-UPS ES850 G2 new"
END LIST UPS
LIST VAR APC_ES850_G2-new
BEGIN LIST VAR APC_ES850_G2-new
VAR APC_ES850_G2-new battery.charge "100"
VAR APC_ES850_G2-new battery.charge.low "10"
VAR APC_ES850_G2-new battery.charge.warning "50"
VAR APC_ES850_G2-new battery.date "2001/09/25"
VAR APC_ES850_G2-new battery.mfr.date "2023/06/19"
VAR APC_ES850_G2-new battery.runtime "1228"
VAR APC_ES850_G2-new battery.runtime.low "120"
VAR APC_ES850_G2-new battery.type "PbAc"
VAR APC_ES850_G2-new battery.voltage "13.5"
VAR APC_ES850_G2-new battery.voltage.nominal "12.0"
VAR APC_ES850_G2-new device.mfr "American Power Conversion"
VAR APC_ES850_G2-new device.model "Back-UPS ES 850G2"
VAR APC_ES850_G2-new device.serial "5B2325T40076  "
VAR APC_ES850_G2-new device.type "ups"
VAR APC_ES850_G2-new driver.name "usbhid-ups"
VAR APC_ES850_G2-new driver.parameter.pollfreq "30"
VAR APC_ES850_G2-new driver.parameter.pollinterval "2"
VAR APC_ES850_G2-new driver.parameter.port "auto"
VAR APC_ES850_G2-new driver.parameter.synchronous "auto"
VAR APC_ES850_G2-new driver.version "2.8.0"
VAR APC_ES850_G2-new driver.version.data "APC HID 0.98"
VAR APC_ES850_G2-new driver.version.internal "0.47"
VAR APC_ES850_G2-new driver.version.usb "libusb-1.0.26 (API: 0x1000109)"
VAR APC_ES850_G2-new input.sensitivity "medium"
VAR APC_ES850_G2-new input.transfer.high "266"
VAR APC_ES850_G2-new input.transfer.low "180"
VAR APC_ES850_G2-new input.voltage "242.0"
VAR APC_ES850_G2-new input.voltage.nominal "230"
VAR APC_ES850_G2-new ups.beeper.status "enabled"
VAR APC_ES850_G2-new ups.delay.shutdown "20"
VAR APC_ES850_G2-new ups.firmware "938.a2 .I USB "
VAR APC_ES850_G2-new ups.load "28"
VAR APC_ES850_G2-new ups.mfr "American Power Conversion"
VAR APC_ES850_G2-new ups.mfr.date "2023/06/19"
VAR APC_ES850_G2-new ups.model "Back-UPS ES 850G2"
VAR APC_ES850_G2-new ups.productid "0002"
VAR APC_ES850_G2-new ups.realpower.nominal "520"
VAR APC_ES850_G2-new ups.serial "5B2325T40076  "
VAR APC_ES850_G2-new ups.status "OL"
VAR APC_ES850_G2-new ups.test.result "No test initiated"
VAR APC_ES850_G2-new ups.timer.reboot "0"
VAR APC_ES850_G2-new ups.timer.shutdown "-1"
VAR APC_ES850_G2-new ups.vendorid "051d"
END LIST VAR APC_ES850_G2-new
^]
telnet> quit
Connection closed.

答案1

愚蠢的我。

我已经解决了这个问题。upsmon.conf 需要从 nut 服务器列出的 ups 实体的准确名称,即 upsmon.conf 的第一行应该是

MONITOR [email protected] 1 [username] [password] secondary
MONITOR [email protected] 0 [username] [password] secondary

相关内容