<div dir="ltr"><div>As a wild guess, your `upsd.conf` tells it to listen on `127.0.0.1` explicitly, which may be why it refuses to listen on wildcard `0.0.0.0`. However the clients connect to `localhost`.</div><div><br></div><div>How is the system name resolution set up (check `/etc/hosts` as a starting point) - can `localhost` there mean IPv6 `::1` as well (or even exclusively)?</div><div><br></div><div>Good luck,</div><div>Jim</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, May 27, 2023 at 5:03 PM Dan G via Nut-upsuser <<a href="mailto:nut-upsuser@alioth-lists.debian.net">nut-upsuser@alioth-lists.debian.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
I've not been able to connect to my ups using NUT 2.7.4 or NUT 2.8.0.<br>
2.7.4 was installed as a package, 2.8.O was compiled from source.<br>
I've messed with permissons, everything is root:root and has the approprate read/execute permissons. I've tried two differnt UPS(es) APC & CyperPower. I'm running PI OS (Raspbian) on a Raspberry Pi3 model B. The port 3493 is open (UFW). I can reach the Pi on the network from another machine on port 3493 (using upsstats.cgi).<br>
<br>
The usbhid-ups driver starts up. But the ups is initally connected, but somehow gets lost. Next comes the message connection refused.<br>
<br>
upsmon keeps running and reports ups battery low - which is true<br>
but nut-monitor and nut-server quit<br>
<br>
Here's the startup:<br>
<br>
in 2.8.0:<br>
<br>
upsdrvctl start<br>
systemctl start nut-server<br>
systemctl start nut-monitor<br>
<br>
Any ideas?<br>
<br>
Thanks, Dan<br>
=========================================<br>
<br>
May 27 09:15:05 RaspBerry-Pi-3 usbhid-ups[2944]: Startup successful<br>
May 27 09:15:13 RaspBerry-Pi-3 systemd[1]: Starting Network UPS Tools - nut-server.service...<br>
May 27 09:15:13 RaspBerry-Pi-3 systemd[1]: Started Network UPS Tools - nut-server.service.<br>
May 27 09:15:13 RaspBerry-Pi-3 nut-server[2948]: fopen /var/run/nut/upsd.pid: No such file or directory<br>
May 27 09:15:13 RaspBerry-Pi-3 nut-server[2948]: Could not find PID file '/var/run/nut/upsd.pid' to see if previous upsd instance is already running!<br>
May 27 09:15:13 RaspBerry-Pi-3 nut-server[2948]: /etc/nut/upsd.conf is world readable<br>
May 27 09:15:13 RaspBerry-Pi-3 nut-server[2948]: listening on 127.0.0.1 port 3943<br>
May 27 09:15:13 RaspBerry-Pi-3 nut-server[2948]: not listening on 0.0.0.0 port 3943<br>
May 27 09:15:13 RaspBerry-Pi-3 upsd[2948]: /etc/nut/upsd.conf is world readable<br>
May 27 09:15:13 RaspBerry-Pi-3 upsd[2948]: listening on 127.0.0.1 port 3943<br>
May 27 09:15:13 RaspBerry-Pi-3 upsd[2948]: not listening on 0.0.0.0 port 3943<br>
May 27 09:15:13 RaspBerry-Pi-3 usbhid-ups[2944]: sock_connect: enabling asynchronous mode (auto)<br>
May 27 09:15:13 RaspBerry-Pi-3 nut-server[2948]: Connected to UPS [ups]: usbhid-ups-ups<br>
May 27 09:15:13 RaspBerry-Pi-3 nut-server[2948]: Found 1 UPS defined in ups.conf<br>
May 27 09:15:13 RaspBerry-Pi-3 upsd[2948]: Connected to UPS [ups]: usbhid-ups-ups<br>
May 27 09:15:13 RaspBerry-Pi-3 upsd[2948]: Found 1 UPS defined in ups.conf<br>
May 27 09:15:13 RaspBerry-Pi-3 nut-server[2948]: /etc/nut/upsd.users is world readable<br>
May 27 09:15:13 RaspBerry-Pi-3 nut-server[2948]: Running as foreground process, not saving a PID file<br>
May 27 09:15:13 RaspBerry-Pi-3 upsd[2948]: /etc/nut/upsd.users is world readable<br>
May 27 09:15:13 RaspBerry-Pi-3 upsd[2948]: Running as foreground process, not saving a PID file<br>
May 27 09:15:17 RaspBerry-Pi-3 systemd[1]: Starting Network UPS Tools - nut-monitor.service...<br>
May 27 09:15:17 RaspBerry-Pi-3 systemd[1]: Started Network UPS Tools - nut-monitor.service.<br>
May 27 09:15:17 RaspBerry-Pi-3 nut-monitor[2952]: fopen /var/run/nut/upsmon.pid: No such file or directory<br>
May 27 09:15:17 RaspBerry-Pi-3 nut-monitor[2952]: Could not find PID file to see if previous upsmon instance is already running!<br>
May 27 09:15:17 RaspBerry-Pi-3 nut-monitor[2952]: UPS: ups@localhost (secondary) (power value 1)<br>
May 27 09:15:17 RaspBerry-Pi-3 nut-monitor[2952]: Using power down flag file /etc/killpower<br>
May 27 09:15:17 RaspBerry-Pi-3 nut-monitor[2953]: upscli_init called but SSL wasn't compiled in<br>
May 27 09:15:17 RaspBerry-Pi-3 nut-monitor[2953]: UPS [ups@localhost]: connect failed: Connection failure: Connection refused<br>
May 27 09:15:17 RaspBerry-Pi-3 nut-monitor[2953]: commbad<br>
May 27 09:15:17 RaspBerry-Pi-3 upsched-cmd.sh:: upsched-cmd.sh running<br>
May 27 09:15:17 RaspBerry-Pi-3 upssched:: commbad<br>
May 27 09:15:17 RaspBerry-Pi-3 nut-monitor[2954]: Network UPS Tools upsmon 2.8.0.1<br>
May 27 09:15:22 RaspBerry-Pi-3 nut-monitor[2953]: UPS [ups@localhost]: connect failed: Connection failure: Connection refused<br>
May 27 09:15:22 RaspBerry-Pi-3 nut-monitor[2953]: nocomm<br>
May 27 09:15:22 RaspBerry-Pi-3 upsched-cmd.sh:: upsched-cmd.sh running<br>
May 27 09:15:22 RaspBerry-Pi-3 upssched:: nocomm<br>
May 27 09:15:22 RaspBerry-Pi-3 nut-monitor[2963]: Network UPS Tools upsmon 2.8.0.1<br>
================================================<br>
NUT configuration 2023-05-27 13:38:31 UTC<br>
<br>
########### Operating system ###########<br>
Kernel release 6.1.21-v7+ GNU/Linux<br>
PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"<br>
NAME="Raspbian GNU/Linux"<br>
VERSION_CODENAME=bullseye<br>
Network UPS Tools upsd 2.8.0.1<br>
Bash version 5.1.4(1)-release<br>
User root<br>
updated-nut-report version: 2020-08-07<br>
<br>
########### USB attached UPS units ###########<br>
Bus 001 Device 005: ID 0b38:0010 Gear Head 107-Key Keyboard<br>
Bus 001 Device 006: ID 051d:0002 American Power Conversion Uninterruptible Power Supply<br>
<br>
########### /etc/nut//nut.conf ###########<br>
MODE=netserver<br>
UPSD_OPTIONS="-DD"<br>
UPSMON_OPTIONS="primary"<br>
<br>
########### /etc/nut//ups.conf ###########<br>
maxretry = 2<br>
[ups]<br>
driver=usbhid-ups<br>
desc="APS BR1600G UPS"<br>
port=auto<br>
<br>
########### /etc/nut//upsd.conf ###########<br>
STATEPATH /var/run/nut<br>
LISTEN 0.0.0.0 3943<br>
LISTEN 127.0.0.1 3943<br>
<br>
########### /etc/nut//upsd.users ###########<br>
[upsmonitor]<br>
password = ****m**** <br>
actions = SET<br>
instcmds = ALL<br>
upsmon master<br>
[admin]<br>
password = ****m**** <br>
actions = SET<br>
instcmds = ALL<br>
upsmon master<br>
[root]<br>
password = ****m**** <br>
actions = SET<br>
instcmds = ALL<br>
upsmon master<br>
[upsmon]<br>
password = ****m**** <br>
actions = SET<br>
instcmds = ALL<br>
upsmon master<br>
[dan]<br>
password = ****m**** <br>
actions = SET<br>
instcmds = ALL<br>
upsmon master<br>
<br>
########### /etc/nut//upsmon.conf ###########<br>
RUN_AS_USER root<br>
MONITOR ups@localhost 1 upsmonitor ****m**** secondary<br>
MINSUPPLIES 1<br>
SHUTDOWNCMD "logger -t upsmon.conf: SHUTDOWN CMD "<br>
NOTIFYCMD /etc/nut/upssched-cmd.sh<br>
POLLFREQ 10<br>
POLLFREQALERT 5<br>
HOSTSYNC 15<br>
DEADTIME 30<br>
POWERDOWNFLAG /etc/killpower<br>
NOTIFYMSG ONLINE "online"<br>
NOTIFYMSG ONBATT "onbatt"<br>
NOTIFYMSG LOWBATT "lowbatt"<br>
NOTIFYMSG FSD "fsd"<br>
NOTIFYMSG COMMOK "commok"<br>
NOTIFYMSG COMMBAD "commbad"<br>
NOTIFYMSG SHUTDOWN "shutdown"<br>
NOTIFYMSG REPLBATT "replacebatt"<br>
NOTIFYMSG NOCOMM "nocomm"<br>
NOTIFYMSG NOPARENT "noparent"<br>
NOTIFYFLAG ONLINE SYSLOG+WALL+EXEC<br>
NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC<br>
NOTIFYFLAG LOWBATT SYSLOG+WALL+EXEC<br>
NOTIFYFLAG FSD SYSLOG+WALL+EXEC<br>
NOTIFYFLAG COMMOK SYSLOG+WALL+EXEC<br>
NOTIFYFLAG COMMBAD SYSLOG+WALL+EXEC<br>
NOTIFYFLAG SHUTDOWN SYSLOG+WALL+EXEC<br>
NOTIFYFLAG REPLBATT SYSLOG+WALL+EXEC<br>
NOTIFYFLAG NOCOMM SYSLOG+WALL+EXEC<br>
NOTIFYFLAG NOPARENT SYSLOG+WALL+EXEC<br>
RBWARNTIME 43200<br>
NOCOMMWARNTIME 10<br>
FINALDELAY 5<br>
<br>
########### /etc/nut//upssched.conf ###########<br>
CMDSCRIPT /etc/nut/upssched-cmd.sh<br>
PIPEFN /run/nut/upssched/upssched.pipe<br>
LOCKFN /run/nut/upssched/upssched.lock<br>
AT ONBATT * EXECUTE START-TIMER onbatttimer 5<br>
AT ONLINE * EXECUTE CANCEL-TIMER onbatttimer online<br>
AT LOWBATT * EXECUTE lowbatt<br>
AT COMMBAD * EXECUTE START-TIMER combaddtimer 5 <br>
AT COMMOK * EXECUTE CANCEL-TIMER combaddtimer commok <br>
AT NOCOMM * EXECUTE nocomm <br>
AT SHUTDOWN * EXECUTE powerdown<br>
AT FSD * EXECUTE fsd<br>
AT NOPARENT * EXECUTE noparent<br>
AT REPLBATT * EXECUTE replacebatt<br>
<br>
########### /etc/nut/upssched-cmd.sh ###########<br>
logger -t upsched-cmd.sh: "upsched-cmd.sh running"<br>
case $1 in<br>
online)<br>
logger -t upssched: "online"<br>
msmtp -t <a href="mailto:dan.grostick@outlook.com" target="_blank">dan.grostick@outlook.com</a> </etc/nut/online.txt<br>
;;<br>
onbatt)<br>
logger -t upssched: "onbatt"<br>
msmtp -t <a href="mailto:dan.grostick@outlook.com" target="_blank">dan.grostick@outlook.com</a> </etc/nut/onbatt.txt<br>
;;<br>
lowbatt)<br>
logger -t upssched: "lowbatt"<br>
msmtp -t <a href="mailto:dan.grostick@outlook.com" target="_blank">dan.grostick@outlook.com</a> </etc/nut/lobatt.txt<br>
;;<br>
commok)<br>
logger -t upssched: "commok"<br>
msmtp -t <a href="mailto:dan.grostick@outlook.com" target="_blank">dan.grostick@outlook.com</a> </etc/nut/commok.txt<br>
;;<br>
commbad)<br>
logger -t upssched: "commbad"<br>
;;<br>
shutdown)<br>
logger -t upssched: "shutdown"<br>
msmtp -t <a href="mailto:dan.grostick@outlook.com" target="_blank">dan.grostick@outlook.com</a> </etc/nut/shutdown.txt<br>
;;<br>
replacebatt)<br>
logger -t upssched: "replacwbatt"<br>
msmtp -t <a href="mailto:dan.grostick@outlook.com" target="_blank">dan.grostick@outlook.com</a> </etc/nut/replacebatt.txt<br>
;;<br>
nocomm)<br>
logger -t upssched: "nocomm"<br>
;;<br>
noparent)<br>
logger -t upssched: "noparent"<br>
msmtp -t <a href="mailto:dan.grostick@outlook.com" target="_blank">dan.grostick@outlook.com</a> </etc/nut/noparent.txt<br>
;;<br>
fsd)<br>
logger -t upssched: "fsd"<br>
msmtp -t <a href="mailto:dan.grostick@outlook.com" target="_blank">dan.grostick@outlook.com</a> </etc/nut/fsd.txt<br>
;;<br>
*)<br>
logger -t upssched: "unknown command $1"<br>
msmtp -t <a href="mailto:dan.grostick@outlook.com" target="_blank">dan.grostick@outlook.com</a> </etc/nut/unknowncommand.txt<br>
;;<br>
esac<br>
<br>
########### /etc/hosts.allow ###########<br>
<br>
########### ps -eLf ###########<br>
<br>
########### Ownership and permissions of executables ###########<br>
-rwxr-xr-x 1 root root 320248 May 22 20:23 /usr/sbin//upsd*<br>
-rwxr-xr-x 1 root root 163620 May 22 20:23 /usr/sbin//upsdrvctl*<br>
-rwxr-xr-x 1 root root 6466 May 22 20:23 /usr/sbin//upsdrvsvcctl*<br>
-rwxr-xr-x 1 root root 182580 May 22 20:23 /usr/sbin//upsmon*<br>
-rwxr-xr-x 1 root root 133112 May 22 20:23 /usr/sbin//upssched*<br>
<br>
########### Ownership and permissions of configuration files ###########<br>
-rw-r--r-- 1 root root 89 May 20 17:46 /etc/nut//commbad.txt<br>
-rw-r--r-- 1 root root 83 May 20 17:46 /etc/nut//commok.txt<br>
-rw-r--r-- 1 root root 79 May 20 17:46 /etc/nut//fsd.txt<br>
-rwxr-xr-x 1 root root 1110 May 20 17:46 /etc/nut//hosts.conf*<br>
-rw-r--r-- 1 root root 79 May 20 17:46 /etc/nut//lowbatt.txt<br>
-rw-r--r-- 1 root root 85 May 20 17:46 /etc/nut//nocomm.txt<br>
-rw-r--r-- 1 root root 79 May 20 17:46 /etc/nut//noparent.txt<br>
-rw-r--r-- 1 root root 1587 May 27 08:51 /etc/nut//nut.conf<br>
-rw-r--r-- 1 root root 79 May 20 17:46 /etc/nut//onbatt.txt<br>
-rw-r--r-- 1 root root 67 May 20 17:46 /etc/nut//online.txt<br>
-rw-r--r-- 1 root root 105 May 20 17:46 /etc/nut//replacebatt.txt<br>
-rw-r--r-- 1 root root 93 May 20 17:46 /etc/nut//shutdown.txt<br>
-rw-r--r-- 1 root root 71 May 20 17:46 /etc/nut//unknowncommand.txt<br>
-rwxr-xr-x 1 root root 5595 May 23 08:35 /etc/nut//ups.conf*<br>
-rwxr-xr-x 1 root root 4594 May 20 17:46 /etc/nut//upsd.conf*<br>
-rwxr-xr-x 1 root root 2539 May 20 17:46 /etc/nut//upsd.users*<br>
-rwxr-xr-x 1 root root 15224 May 23 15:03 /etc/nut//upsmon.conf*<br>
-rwxr----- 1 root root 1211 May 20 17:46 /etc/nut//upssched-cmd.sh*<br>
-rwxr-xr-x 1 root root 4270 May 20 17:46 /etc/nut//upssched.conf*<br>
-rwxr-xr-x 1 root root 4178 May 20 17:46 /etc/nut//upssched.conf.bak*<br>
-rwxr-xr-- 1 root root 1201 May 20 17:46 /etc/nut//upssched.sh*<br>
<br>
/etc/nut//sample:<br>
total 88<br>
drwxr-xr-x 2 root root 4096 May 23 10:18 ./<br>
drwxr-xr-x 5 root root 4096 May 27 08:51 ../<br>
-rw-r--r-- 1 root root 1071 May 22 20:23 hosts.conf.sample<br>
-rw-r--r-- 1 root root 1911 May 22 20:23 nut.conf.sample<br>
-rw-r--r-- 1 root root 9269 May 22 20:23 ups.conf.sample<br>
-rw-r--r-- 1 root root 7477 May 22 20:23 upsd.conf.sample<br>
-rw-r--r-- 1 root root 2349 May 22 20:23 upsd.users.sample<br>
-rw-r--r-- 1 root root 21243 May 22 20:23 upsmon.conf.sample<br>
-rw-r--r-- 1 root root 4213 May 22 20:23 upssched.conf.sample<br>
<br>
/etc/nut//share:<br>
total 12<br>
drwxr-xr-x 3 root root 4096 May 20 17:31 ./<br>
drwxr-xr-x 5 root root 4096 May 27 08:51 ../<br>
drwxr-xr-x 3 root root 4096 May 22 20:23 nut-monitor/<br>
<br>
/etc/nut//usbdriver:<br>
total 1248<br>
drwxr-xr-x 2 root root 4096 May 22 20:23 ./<br>
drwxr-xr-x 5 root root 4096 May 27 08:51 ../<br>
-rwxr-xr-x 1 root root 299392 May 22 20:23 apcupsd-ups*<br>
-rwxr-xr-x 1 root root 286620 May 22 20:23 skel*<br>
-rwxr-xr-x 1 root root 677060 May 22 20:23 usbhid-ups*<br>
<br>
########### Custom NOTIFYCMD scheduler /etc/nut/upssched-cmd.sh ###########<br>
logger -t upsched-cmd.sh: "upsched-cmd.sh running"<br>
case $1 in<br>
online)<br>
logger -t upssched: "online"<br>
msmtp -t <a href="mailto:dan.grostick@outlook.com" target="_blank">dan.grostick@outlook.com</a> </etc/nut/online.txt<br>
;;<br>
onbatt)<br>
logger -t upssched: "onbatt"<br>
msmtp -t <a href="mailto:dan.grostick@outlook.com" target="_blank">dan.grostick@outlook.com</a> </etc/nut/onbatt.txt<br>
;;<br>
lowbatt)<br>
logger -t upssched: "lowbatt"<br>
msmtp -t <a href="mailto:dan.grostick@outlook.com" target="_blank">dan.grostick@outlook.com</a> </etc/nut/lobatt.txt<br>
;;<br>
commok)<br>
logger -t upssched: "commok"<br>
msmtp -t <a href="mailto:dan.grostick@outlook.com" target="_blank">dan.grostick@outlook.com</a> </etc/nut/commok.txt<br>
;;<br>
commbad)<br>
logger -t upssched: "commbad"<br>
;;<br>
shutdown)<br>
logger -t upssched: "shutdown"<br>
msmtp -t <a href="mailto:dan.grostick@outlook.com" target="_blank">dan.grostick@outlook.com</a> </etc/nut/shutdown.txt<br>
;;<br>
replacebatt)<br>
logger -t upssched: "replacwbatt"<br>
msmtp -t <a href="mailto:dan.grostick@outlook.com" target="_blank">dan.grostick@outlook.com</a> </etc/nut/replacebatt.txt<br>
;;<br>
nocomm)<br>
logger -t upssched: "nocomm"<br>
;;<br>
noparent)<br>
logger -t upssched: "noparent"<br>
msmtp -t <a href="mailto:dan.grostick@outlook.com" target="_blank">dan.grostick@outlook.com</a> </etc/nut/noparent.txt<br>
;;<br>
fsd)<br>
logger -t upssched: "fsd"<br>
msmtp -t <a href="mailto:dan.grostick@outlook.com" target="_blank">dan.grostick@outlook.com</a> </etc/nut/fsd.txt<br>
;;<br>
*)<br>
logger -t upssched: "unknown command $1"<br>
msmtp -t <a href="mailto:dan.grostick@outlook.com" target="_blank">dan.grostick@outlook.com</a> </etc/nut/unknowncommand.txt<br>
;;<br>
esac<br>
=============================================================================<br>
<br>
_______________________________________________<br>
Nut-upsuser mailing list<br>
<a href="mailto:Nut-upsuser@alioth-lists.debian.net" target="_blank">Nut-upsuser@alioth-lists.debian.net</a><br>
<a href="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser" rel="noreferrer" target="_blank">https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser</a><br>
</blockquote></div>