Gregory Deal via plug on 28 Mar 2025 09:20:25 -0700
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
[PLUG] Going nuts with NUT
|
- From: Gregory Deal via plug <plug@lists.phillylinux.org>
- To: PLUG <plug@lists.phillylinux.org>
- Subject: [PLUG] Going nuts with NUT
- Date: Fri, 28 Mar 2025 12:20:18 -0400 (EDT)
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=20190202a; t=1743178819; bh=MG0R3h4CakNuFgxvylVJuTX4in1AxZzlgqty8PYdAdw=; h=Received:Received:Date:From:To:Message-ID:Subject:MIME-Version: Content-Type:Xfinity-Spam-Result; b=FT9sNuuVTEkUWY0O73tD2p18ZWqzCYAuuGaTMpqvO25TJwmAeBE1krgB8b+guxmN9 16gp1idRtH9xRY9CboiNZnaXo8RTPL/mY90jHBfY1Ya+GrOlcmhWrT6HFT5Rnh0hGb Qmp1teA58qBF6OeoHVvOPBMo8I/2Qh0wi3LG79eEDCPux4wHMnYBv0Ki2tX8NkUZ7K MoCdK4tm74lz4yL7AzUjTQuobwVSa29G6Hty2BSdaUhcbRGhuQ8g+qeKSxWrpDJWz0 nNPDxsL45Wb8UxlD+kIfwvx+AwiHlRIajRHFFbYw+HP6oAqmPbjaI2Zs/mlSPE2e2X Sgs+hEavfEMYA==
- Reply-to: Gregory Deal <1deal@comcast.net>
- Sender: "plug" <plug-bounces@lists.phillylinux.org>
I'm trying to have a UPS shutdown multiple computers (2 Macs and a NAS). Initially I thought "how do you connect a single UPS to multiple machines?". Some initial searching suggests using NUT (Network UPS Tools) to have the computer attached to the UPS direct the remaining ones to also shutdown. Looking further into results, tutorials, and networkupstools.org/docs/user-manual.chunked, I then did what I thought was needed to various conf's and users files. I think I'm getting close, but I suspect I'm missing something simple, so I hope someone can say "Hey, just add this line to this file".
Details:
I have an APC UPS BE850G2 which claims to support monitoring. A Mac Studio is attached to it over a USB cable. The Mac's "System Information" shows it in the USB Devices section. And the "System Settings" "Energy Saver" "UPS Options" presents the basic options of "Shut down after using UPS battery for ........, time remaining on UPS battery . . . , UPS battery level below . . .", so it looks like the UPS is correctly connected and able to be talked to.
I then installed nut (brew install nut), and set up various conf/users files like I thought search results suggested for my situation:
[Gregorys-Mac-Studio]:(gkd) /opt/homebrew/etc/nut $ ll
total 280
-rw-r--r-- 1 gkd admin 4791 Mar 27 13:28 nut.conf
-rw-r--r-- 1 gkd admin 4774 Mar 26 12:21 nut.conf.sample
-rw-r--r-- 1 gkd admin 10468 Mar 27 14:00 ups.conf
-rw-r--r-- 1 gkd admin 10409 Mar 26 12:21 ups.conf.sample
-rw-r--r-- 1 gkd admin 9207 Mar 27 12:37 upsd.conf
-rw-r--r-- 1 gkd admin 9207 Mar 26 12:21 upsd.conf.sample
-rw-r--r-- 1 gkd admin 2423 Mar 27 13:16 upsd.users
-rw-r--r-- 1 gkd admin 2349 Mar 27 11:37 upsd.users.sample
-rw-r--r-- 1 gkd admin 24843 Mar 27 13:16 upsmon.conf
-rw-r--r-- 1 gkd admin 24767 Mar 26 12:21 upsmon.conf.sample
-rw-r--r-- 1 gkd admin 4269 Mar 26 12:21 upssched.conf.sample
In nut.conf:
< MODE=none
---
> # MODE=none
> MODE=netserver
In ups.conf:
> # 20250327 gkd
> [myups]
> driver = usbhid-ups (from NUT's hardware compatibility list)
> port = auto
No changes in upsd.conf
In upsd.users:
> # 20250327 gkd
> [gkd]
> password = pw
> upsmon primary
In upsmon.conf:
> RUN_AS_USER gkd
118a120,121
> # 20250327 gkd
> MONITOR myups@localhost 1 gkd pw primary
Trying stuff, running "upsmon" gets:
[Gregorys-Mac-Studio]:(gkd) /opt/homebrew/etc/nut $ upsmon
Network UPS Tools upsmon 2.8.2
kill: No such process
UPS: myups@localhost (primary) (power value 1)
Using power down flag file /etc/killpower
Broadcast Message from gkd@Gregorys-Mac-Studio.local
(no tty) at 12:08 EDT...
Communications with UPS myups@localhost lost
Broadcast Message from gkd@Gregorys-Mac-Studio.local
(no tty) at 12:08 EDT...
UPS myups@localhost is unavailable
(and continues to ding every few minutes).
I saw that "upsdrvctl" might supply some interrogation/control, but:
[Gregorys-Mac-Studio]:(gkd) /opt/homebrew/etc/nut $ upsdrvctl start
Network UPS Tools - UPS driver controller 2.8.2
Network UPS Tools - Generic HID driver 0.53 (2.8.2)
USB communication driver (libusb 1.0) 0.47
Can't claim USB device [051d:0002]@0/0/0: Access denied (insufficient permissions)
upsnotify: failed to notify about state 4: no notification tech defined, will not spam more about it
Driver failed to start (exit status=1)
Network UPS Tools - Generic HID driver 0.53 (2.8.2)
USB communication driver (libusb 1.0) 0.47
Can't claim USB device [051d:0002]@0/0/0: Access denied (insufficient permissions)
upsnotify: failed to notify about state 4: no notification tech defined, will not spam more about it
Driver failed to start (exit status=1)
Network UPS Tools - Generic HID driver 0.53 (2.8.2)
USB communication driver (libusb 1.0) 0.47
Can't claim USB device [051d:0002]@0/0/0: Access denied (insufficient permissions)
upsnotify: failed to notify about state 4: no notification tech defined, will not spam more about it
Driver failed to start (exit status=1)
Poking around:
[Gregorys-Mac-Studio]:(gkd) /opt/homebrew/etc/nut $ ps -ef|grep ups
0 177 1 0 Wed01PM ?? 0:06.72 /usr/sbin/cupsd -l
0 395 1 0 Wed01PM ?? 0:32.25 /usr/libexec/ioupsd
501 5170 1 0 2:12PM ?? 0:07.89 upsd
501 7622 1 0 12:08PM ?? 0:00.00 upsmon
501 7623 7622 0 12:08PM ?? 0:00.04 upsmon
501 7647 608 0 12:14PM ttys000 0:00.00 grep ups
To kill the dinging:
[Gregorys-Mac-Studio]:(gkd) /opt/homebrew/etc/nut $ upsmon -c stop
So, can this scheme work? Am I close? Anything else to try?
Thanks.
Greg
___________________________________________________________________________
Philadelphia Linux Users Group -- http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug