Project · Go · Telegram · Monitoring

tgn-stack

A self-hosted Telegram-first monitoring and notification stack for Linux servers. Built for simple checks, operational alerts, recovery messages, shell scripts, systemd units and infrastructure automation.

tgn-relaygateway
tgnctlcli
tgn-watchchecks
telegram alertsent

What is tgn-stack?

tgn-stack is a small production-ready stack for sending server alerts and recovery notifications to Telegram without deploying a heavy monitoring platform.

tgn-relay

Go notification relay and Telegram Bot API gateway. It receives internal requests and sends messages to configured Telegram groups.

GoTelegram APIRelay

tgnctl

CLI wrapper for sending notifications from shell scripts, cron jobs, systemd units, deployment hooks and operational automation.

CLIShellsystemd

tgn-watch

Lightweight monitoring agent for simple server checks with alert and recovery notifications through tgn-relay.

MonitoringChecksRecovery

Supported checks

tgn-watch is focused on practical server checks that are useful for small infrastructure nodes, VPS, bare metal servers and self-hosted services.

Network checks

HTTP endpoints, TCP ports, DNS resolution and TLS certificate expiration.

HTTPTCPDNSTLS

System checks

systemd units, disk usage, memory usage, running processes and file age.

systemdDiskMemoryProcess

Custom checks

Run custom commands and send Telegram alerts when command status does not match the expected result.

CommandScriptsAutomation

Architecture

server checks / scripts / systemd / cron
        |
        | tgnctl or tgn-watch
        v
    tgn-relay
        |
        | Telegram Bot API
        v
 Telegram group / operator chat

Quick example

Send a notification from shell:

tgnctl --tag deploy "Deployment completed successfully"

Use tgn-watch for lightweight monitoring:

checks:
  - name: openbld-site
    type: http
    url: https://openbld.net
    interval: 30s

  - name: dns-port
    type: tcp
    host: 127.0.0.1
    port: 53
    interval: 10s

  - name: nginx
    type: systemd
    unit: nginx.service
    interval: 30s

Good fit for

Self-hosted infrastructure

Small services, VPS, DNS nodes, proxies, monitoring helpers and internal tools.

Operational alerts

systemd failures, backups, deployment hooks, TLS expiry and custom scripts.

OpenBLD production usage

The stack is already used in production inside OpenBLD infrastructure.