Overview

Last updated: July 24, 2026

ServerPing Overview (serverping/)

Multi-server TCP/HTTP/SSL monitoring with per-group WhatsApp alerts and a web dashboard. Added July 4, 2026 (commit 11f7513c).

Purpose

Continuous uptime monitoring for all dLAN infrastructure servers. Each server is checked on a configurable interval for:

  • TCP port reachability (e.g., SSH on port 22, custom ports)
  • HTTP response codes (GET requests)
  • SSL certificate expiry (TLS handshakes + cert parsing)

Failures trigger WhatsApp alerts to the relevant group (Sysafe, LondonHosting, Delicious). Recovery messages are sent when a server comes back up.

Architecture

serverping/
├── serverping.go          # Core monitoring loop, checks, alert logic, dashboard handlers
└── (no separate files)    # Single-file package

Key Types

Type Purpose
ServerPing Main struct — holds server configs, statuses, group mappings, stop channel
ServerConfig Per-server definition: hostname, display name, group, ports, HTTP/SSL flags
ServerStatus Runtime state: up/down, last check, consecutive failures, alert sent flag
PortStatus Per-port TCP check result (alive bool)
GroupConfig WhatsApp group name + JID for alert routing

Default Groups

Group WhatsApp JID
Sysafe 120363239955493967@g.us
LondonHosting 120363258588369541@g.us
Delicious 120363259248270724@g.us

Default Servers

Hostname Display Name Group Ports HTTP SSL
druid.sysafe.co.uk Druid.Sysafe Sysafe 22, 4085 yes yes
hosting.sysafe.co.uk Hosting.Sysafe Sysafe 22, 80, 443 yes yes
ldn.london-hosting.com LDN.LH LondonHosting 22, 80, 443 yes yes
uk.delicious-webdesign.com UK.Delicious Delicious 22, 80, 443 yes yes
delicious.enhanced-performance.net Enhanced-Performance Sysafe 80, 443 yes yes

Integration

Registered in main.go alongside other services:

http.HandleFunc("/server-ping", serverping.DashboardHandler)
http.HandleFunc("/api/server-ping", serverping.StatusJSONHandler)
go serverping.StartServerPing()

Endpoints

Endpoint Method Purpose
/server-ping GET HTML dashboard showing all servers + SSL expiry + port status
/api/server-ping GET JSON status feed for programmatic access

Alert Logic

  • Down alert: Sent when ConsecutiveFailures reaches threshold; DownAlertSent flag prevents duplicate alerts
  • Recovery alert: Sent on first successful check after a failure period
  • Per-group routing: Alerts only go to the WhatsApp group that owns the server

Key Files

File Purpose
serverping/serverping.go All monitoring, checks, alerts, and dashboard handlers

Cross-References