Skip to content

fix(notifications): use real server name in remote threshold alerts#4791

Open
PixelPerfector wants to merge 1 commit into
Dokploy:canaryfrom
PixelPerfector:fix/remote-threshold-server-name
Open

fix(notifications): use real server name in remote threshold alerts#4791
PixelPerfector wants to merge 1 commit into
Dokploy:canaryfrom
PixelPerfector:fix/remote-threshold-server-name

Conversation

@PixelPerfector

@PixelPerfector PixelPerfector commented Jul 10, 2026

Copy link
Copy Markdown

Describe your changes

Server CPU/Memory threshold notifications for remote servers always render Server Name: Remote instead of the actual server name. When more than one remote server is registered, every alert is identical and it's impossible to tell which server actually breached the threshold.

The remote branch of receiveNotification already fetches the matching server row (looked up by its metrics token), but it throws the row away and hardcodes the literal string "Remote":

organizationId = result?.[0]?.organizationId;
ServerName = "Remote";           // <- before

This uses the fetched row's name instead, falling back to "Remote" if it is somehow absent:

organizationId = result?.[0]?.organizationId;
ServerName = result?.[0]?.name ?? "Remote";   // <- after

The Dokploy (web server) branch is unaffected — it already reports "Dokploy", which is unambiguous. All channels (Telegram/Discord/Slack/etc.) share the same payload.ServerName, so they are all fixed by this change.

Issue ticket number and link

No issue reports this exact bug. Related to #3589 — the same "which server?" problem, but for the server restart notification (a separate notification and a feature request); this PR addresses it for the monitoring threshold notification.

Checklist before requesting a review

  • I have performed a self-review of my code
  • The change is a minimal, backwards-compatible bug fix (single line)

How was it tested?

On a self-hosted instance with 5 remote servers, sending a synthetic threshold POST to notification.receiveNotification with a given server's metrics token now delivers a Telegram alert reading e.g. Server Name: panda-aggregator instead of Server Name: Remote. Discord/Slack/other channels use the same payload.ServerName, so they are fixed identically.

🤖 Generated with Claude Code

Server CPU/Memory threshold notifications for remote servers always
showed "Server Name: Remote" instead of the actual server name, making
it impossible to tell which server triggered the alert when more than
one remote server is registered.

The remote branch of receiveNotification already fetches the matching
server row (looked up by its metrics token) but discarded it, hardcoding
ServerName to the literal "Remote". Use the fetched row's name instead,
falling back to "Remote" if it is somehow absent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working labels Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant