[Nut-upsuser] UPS heartbeat on battery

Dan Langille dan at langille.org
Mon Mar 31 18:50:13 BST 2025


On Mon, Mar 31, 2025, at 8:40 AM, Jim Klimov wrote:
> Thinking of it, there was a change to handling of files by dummy-ups around 2.8.0 release: depending on an explicit setting or a file extension:
> 
> > Specify mode instead of guessing it from port value (dummy = dummy-loop, dummy-once, repeater) : -x mode=<value>
> 
> As the man page goes, by default "*.dev"=>"dummy-once" (emulate a device snapshot, so once to the end of file and stop) and "*.seq"=>"dummy-loop" (run a device behavior sequence, so looping).
> 
> Jim

The man page in question: https://networkupstools.org/docs/man/dummy-ups.html

Found there: "and dummy is assigned by default to files with other naming patterns that the driver could not classify."

I changed my configuration to use heartbeat.seq instead. Seems to work fine.

My next goal: testing the time out. That, so far, has been unsuccessful. The on-battery 

The upssched has a timer of 120, just so it times out faster. I've tried other values.

/usr/local/bin/upssched-cmd-local should get invoked - it is not. It logs; no logs are seen. Running it from the command line invokes the expected log entries and sends a notification to my phone via Pushover.net

Config:

[16:07 gw01 dvl /usr/local/etc/nut] % sudo cat upssched.conf
CMDSCRIPT /usr/local/bin/upssched-cmd-local

PIPEFN /var/db/nut/upssched.pipe
LOCKFN /var/db/nut/upssched.lock

AT ONBATT local-heartbeat CANCEL-TIMER heartbeat-failure-timer
AT ONBATT local-heartbeat START-TIMER  heartbeat-failure-timer 120

^ that never invokes the CMDSCRIPT shown above. That is what I am attempting to test now.


The UPS config:

[16:25 gw01 dvl /usr/local/etc/nut] % sudo cat ups.conf
maxretry = 3
user = nut

[heartbeat]
  driver = dummy-ups
  port = heartbeat.seq
  desc = Watch over NUT

[ups04]
  driver = usbhid-ups
  port = auto
  serial = [redacted]
  desc = Primary UPS

Heartbeat config:

[16:26 gw01 dvl /usr/local/etc/nut] % cat heartbeat.seq 
ups.status: OL
TIMER 300
ups.status: OB
TIMER 300

Thank you

--
  Dan Langille
  dan at langille.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/nut-upsuser/attachments/20250331/56294a44/attachment.htm>


More information about the Nut-upsuser mailing list