无法让upsmon服务开始监视(并响应)远程UPS

我无法安装螺母来监视连接到Buffalo LinkStation Duo的单个远程UPS。 我可以使用upsc [email protected]手动正确地读取它的状态,它是用户/无密码的。

长期以来,我想要的是我的系统监控这个远程UPS – 如果它进入电池操作,我希望我的系统closures(UPS行为本身将由LinkStation Duopipe理)。

相关的configuration文件

 #/etc/nut/upsmon.conf MONITOR [email protected] MINSUPPLIES 1 SHUTDOWNCMD "/sbin/shutdown -h +0" POLLFREQ 5 POLLFREQALERT 5 HOSTSYNC 15 DEADTIME 15 POWERDOWNFLAG /etc/killpower NOTIFYMSG ONLINE "UPS %s on line power" NOTIFYMSG ONBATT "UPS %s on battery" NOTIFYMSG FSD "UPS %s: forced shutdown in progress" NOTIFYMSG SHUTDOWN "Auto logout and shutdown proceeding" NOTIFYFLAG ONLINE SYSLOG+WALL NOTIFYFLAG ONBATT SYSLOG+WALL NOTIFYFLAG FSD SYSLOG+WALL NOTIFYFLAG SHUTDOWN SYSLOG+WALL RBWARNTIME 43200 NOCOMMWARNTIME 300 FINALDELAY 5 

 #/etc/nut/nut.conf MODE=netclient 

其他的configuration文件是不变的 – 也就是说它们没有实现任何本地的UPS(但没有),但是我认为这可能是我的问题的一部分,就像在/var/log/syslog我们在启动之后所做的那样:

 upsdrvctl[559]: Network UPS Tools - UPS driver controller 2.7.2 upsmon[588]: fopen /var/run/nut/upsmon.pid: No such file or directory upsmon[588]: /etc/nut/upsmon.conf line 86: invalid directive MONITOR [email protected] upsmon[588]: Using power down flag file /etc/killpower upsmon[588]: Network UPS Tools upsmon 2.7.2 upsmon[588]: Fatal error: insufficient power configured! upsmon[588]: Sum of power values........: 0 upsmon[588]: Minimum value (MINSUPPLIES): 1 upsmon[588]: Edit your upsmon.conf and change the values. 

所以upsmon不认为我已经正确configuration了远程UPS – 但我不知道如何configuration它为用户/无密码。 任何帮助将受到感谢 – 我已经花了相当一段时间在谷歌上,并发现自己卡住了。

你需要编辑/etc/nut/upsd.users (在你的情况下,在buffalo.local),并定义一个upsmon用户,如下所示:

 [yourupsmonuser] password = somerandompassword upsmon master 

然后在/etc/nut/upsmon.conf (在“监视”机器上)将MONITOR行设置为

 MONITOR yourups@yourhost 1 yourupsmonuser somerandompassword master 

使用systemctl enable nut-monitor应该是。 只要注意SystemD在networking可用之前启动您的upsmon实例 – 在编辑/etc/nut/upsmon.conf以增加DEADTIME之前,将无法断言MINSUPPLIES 1并触发您的计算机的closures。 提示很多“乐趣”。