Skip to content

[Bug]: Real UPS events fail to send Telegram and email notifications in Multi Monitor mode #192

Description

@cimo77

Nutify version and image tag

0.3.0 / dartsteven/nutify:0.3.0-amd64

Host OS and architecture

Debian 13 (Trixie), AMD64, Docker

UPS and NUT environment

Nutify is running in Multi Monitor mode.

Affected target:

  • UPS: APC Smart-UPS SMT1500IC
  • NUT server: remote Raspberry Pi
  • NUT driver: usbhid-ups
  • UPS identifier: smt1500
  • Connection from Nutify: smt1500@10.0.0.63
  • NUT port: 3493

Nutify monitors three remote NUT servers in total. The issue described here was reproduced on the SMT1500IC target.

Reproduction steps

  1. Configure Nutify in Multi Monitor mode with a remote NUT target.
  2. Configure Telegram and email providers.
  3. Enable both Telegram and Mail for ONBATT and ONLINE in the target's Event Matrix.
  4. Verify that provider test notifications work successfully.
  5. Disconnect AC power from the UPS.
  6. Nutify correctly detects and records the ONBATT event in Recent Events.
  7. Restore AC power.
  8. Nutify correctly detects and records the ONLINE event.
  9. Check the notification logs.

Expected behavior

When a real UPS state change occurs, Nutify should send notifications through every provider enabled for that event in the target's Event Matrix.

For ONBATT:

  • The ONBATT event should be recorded in Nutify.
  • A Telegram notification should be sent.
  • An email notification should be sent.

The same should happen for ONLINE when AC power is restored.

Actual behavior

Nutify correctly detects and stores the real ONBATT event, but notification delivery fails.

Telegram:
Processing 1 Telegram configurations for ONBATT
Sending Telegram notification 1/1 using config ID 1
ERROR: Failed to send Telegram notification: name 'get_server_name' is not defined

Email:
Mail send trace event=ONBATT target_id=1 config_id=1 render_mode=graphic recipient=
ERROR: Failed to send notification: No valid recipient email address provided

The same two errors are also logged for the subsequent real ONLINE event.

Provider test notifications work successfully, so the problem appears to occur specifically when notifications are dispatched from real UPS events.

Sanitized logs and screenshots

Real ONBATT event:

2026-09-16 16:15:27 - Parsed UPS_NAME=smt1500@10.0.0.63, EVENT_TYPE=ONBATT
2026-09-16 16:15:27 - UPS 'smt1500@10.0.0.63' is ON BATTERY - Power failure detected
2026-09-16 16:15:27 - Stored ONBATT event for smt1500@10.0.0.63 in database

2026-09-16 16:15:27 - Sending notification for event type: ONBATT
2026-09-16 16:15:27 - Mail send trace event=ONBATT target_id=1 config_id=1 render_mode=graphic recipient=
2026-09-16 16:15:27 - ERROR: Failed to send notification: No valid recipient email address provided

2026-09-16 16:15:27 - Processing 1 Telegram configurations for ONBATT
2026-09-16 16:15:27 - Sending Telegram notification 1/1 using config ID 1
2026-09-16 16:15:27 - ERROR: Failed to send Telegram notification: name 'get_server_name' is not defined

Real ONLINE event after restoring AC power:

2026-09-16 16:16:02 - Parsed UPS_NAME=smt1500@10.0.0.63, EVENT_TYPE=ONLINE
2026-09-16 16:16:02 - Stored ONLINE event for smt1500@10.0.0.63 in database
2026-09-16 16:16:02 - ERROR: Failed to send notification: No valid recipient email address provided
2026-09-16 16:16:02 - ERROR: Failed to send Telegram notification: name 'get_server_name' is not defined

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions