Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
$ upsc qnapups@192.168.1.52


Installing NUT on Mac

Code Block
> brew install nut

==> Downloading https://ghcr.io/v2/homebrew/core/nut/manifests/2.8.1
######################################################################### 100.0%
==> Fetching nut
==> Downloading https://ghcr.io/v2/homebrew/core/nut/blobs/sha256:e89241f392bb9f
######################################################################### 100.0%
==> Pouring nut--2.8.1.arm64_sonoma.bottle.tar.gz
Warning: The post-install step did not complete successfully
You can try again using:
  brew postinstall nut
==> Caveats
To start nut now and restart at login:
  brew services start nut
Or, if you don't want/need a background service you can just run:
  /opt/homebrew/opt/nut/sbin/upsmon -D
==> Summary
🍺  /opt/homebrew/Cellar/nut/2.8.1: 94 files, 12MB
==> Running `brew cleanup nut`...

Didn't work.....


Troubleshooting

ProblemDetails 
UPS Shutting Down

Sometimes the UPS shutdown for no reason.  No power outage.

cat /var/log/syslog |grep ups

Mar 16 02:09:28 pihole upsmon[390]: UPS qnapups@localhost on battery
Mar 16 02:09:28 pihole upsd[381]: Client upsmon@127.0.0.1 set FSD on UPS [qnapups]
Mar 16 02:09:36 pihole upsmon[390]: Executing automatic power-fail shutdown
Mar 16 02:09:36 pihole upsmon[390]: Auto logout and shutdown proceeding
Mar 16 03:10:07 pihole kernel: [    0.000000] ftrace: allocated 60 pages with 4 groups
Mar 16 03:10:07 pihole dbus-daemon[275]: [system] Activating systemd to hand-off: service name='org.freedesktop.ColorManager' unit='colord.service' requested by ':1.1' (uid=0 pid=252 comm="/usr/sbin/cupsd -l ")
Mar 16 03:10:10 pihole upsdrvctl[342]: Using subdriver: APC HID 0.96
Mar 16 03:10:10 pihole upsdrvctl[342]: Network UPS Tools - Generic HID driver 0.41 (2.7.4)
Mar 16 03:10:10 pihole upsdrvctl[342]: USB communication driver 0.33
Mar 16 03:10:10 pihole upsdrvctl[342]: Network UPS Tools - UPS driver controller 2.7.4
Mar 16 03:10:10 pihole usbhid-ups[368]: Startup successful
Mar 16 03:10:11 pihole upsd[374]: fopen /var/run/nut/upsd.pid: No such file or directory
Mar 16 03:10:11 pihole upsd[374]: listening on 0.0.0.0 port 3493
Mar 16 03:10:11 pihole upsd[374]: listening on 0.0.0.0 port 3493
Mar 16 03:10:11 pihole upsd[374]: Connected to UPS [qnapups]: usbhid-ups-qnapups
Mar 16 03:10:11 pihole upsd[374]: Connected to UPS [qnapups]: usbhid-ups-qnapups
Mar 16 03:10:12 pihole upsd[381]: Startup successful
Mar 16 03:10:14 pihole upsmon[389]: fopen /var/run/nut/upsmon.pid: No such file or directory
Mar 16 03:10:14 pihole upsmon[389]: UPS: qnapups@localhost (master) (power value 1)
Mar 16 03:10:14 pihole upsmon[391]: Startup successful
Mar 16 03:10:14 pihole systemd[1]: nut-monitor.service: Can't open PID file /run/nut/upsmon.pid (yet?) after start: No such file or directory
Mar 16 03:10:14 pihole upsmon[392]: Init SSL without certificate database
Mar 16 03:10:14 pihole upsd[381]: User upsmon@127.0.0.1 logged into UPS [qnapups]
Mar 16 03:10:14 pihole upsmon[392]: UPS qnapups@localhost battery is low


Unplugging the power and querying the UPS showed a charge of 0!

> upsc qnapups@localhost |grep battery


Init SSL without certificate database
battery.charge: 0
battery.charge.low: 10
battery.charge.warning: 50
battery.date: 2001/09/25
battery.mfr.date: 2010/09/05
battery.runtime: 0
battery.runtime.low: 120
battery.type: PbAc
battery.voltage: 13.4
battery.voltage.nominal: 12.0


Get NUT status

sudo service nut-server status
● nut-server.service - Network UPS Tools - power devices information server
   Loaded: loaded (/lib/systemd/system/nut-server.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2024-03-16 03:10:12 EDT; 6h ago
  Process: 374 ExecStart=/sbin/upsd (code=exited, status=0/SUCCESS)
 Main PID: 381 (upsd)
    Tasks: 1 (limit: 877)
   CGroup: /system.slice/nut-server.service
           └─381 /lib/nut/upsd

Mar 16 03:10:11 pihole upsd[374]: fopen /var/run/nut/upsd.pid: No such file or directory
Mar 16 03:10:11 pihole upsd[374]: listening on 0.0.0.0 port 3493
Mar 16 03:10:11 pihole upsd[374]: listening on 0.0.0.0 port 3493
Mar 16 03:10:11 pihole upsd[374]: Connected to UPS [qnapups]: usbhid-ups-qnapups
Mar 16 03:10:11 pihole upsd[374]: Connected to UPS [qnapups]: usbhid-ups-qnapups
Mar 16 03:10:12 pihole upsd[381]: Startup successful
Mar 16 03:10:12 pihole systemd[1]: Started Network UPS Tools - power devices information server.
Mar 16 03:10:14 pihole upsd[381]: User upsmon@127.0.0.1 logged into UPS [qnapups]
Mar 16 09:26:09 pihole upsd[381]: User upsmon@127.0.0.1 logged into UPS [qnapups]
Mar 16 09:26:20 pihole upsd[381]: User deepthought@192.168.1.50 logged into UPS [qnapups]

 

Querying UPS
upsc qnapups@localhost

$ upsc qnapups@192.168.1.52

battery.charge: 100
battery.charge.low: 10
...
ups.vendorid: 051d

...