DEV Community

Sam Hartley
Sam Hartley

Posted on

I Use Telegram as My DevOps Dashboard — No Web UI, No VPN, Just Works

I have a bunch of things running 24/7 on a Mac Mini. GPU rental jobs, a Garmin watch face updater, a Fiverr inbox monitor, a funding rate tracker, a few cron jobs.

For a while I ran a Grafana dashboard to keep an eye on them. It looked impressive. I never opened it.

What I actually do is check my phone. So I built the monitoring layer there.

Here's the setup: a lightweight Telegram bot that serves as my entire DevOps interface. Status checks, alerts, and even simple commands — all from the Telegram app I already have open.

Why Not a Proper Dashboard?

Honest answer: dashboards are for teams. If you're a solo dev with a few projects, a fancy web UI creates more overhead than it solves.

Problems I had with Grafana:

  • VPN required to reach it from outside my home network
  • Needs to stay running (another thing to maintain)
  • I never actually opened the browser tab
  • It didn't push me information — I had to pull it

Telegram flips this: it pushes alerts to me. I glance at my phone, see what's happening, and move on.

The Architecture

Services (cron jobs, Python scripts, shell scripts)
  ↓
Central alert script: notify.sh
  ↓
Telegram Bot API → my phone
  ↓ (optional)
Command bot → runs queries on server
Enter fullscreen mode Exit fullscreen mode

Two pieces:

  1. Outbound alerts — services send me messages when things happen
  2. Inbound commands — I can ask the bot questions from my phone

Part 1: Dead Simple Alert Script

Every service on my server can call this:

#!/bin/bash
# notify.sh — send a Telegram message from any script
# Usage: ./notify.sh "Your GPU job finished"

BOT_TOKEN="your_bot_token_here"
CHAT_ID="your_chat_id_here"
MESSAGE="$1"

curl -s -X POST "https://api.telegram.org/bot${BOT_TOKEN}/sendMessage" \
  -d chat_id="${CHAT_ID}" \
  -d text="${MESSAGE}" \
  -d parse_mode="HTML" > /dev/null
Enter fullscreen mode Exit fullscreen mode

That's it. Any script can now send me a message in one line:

./notify.sh "✅ GPU rental job completed — earned $2.40"
./notify.sh "⚠️ Funding rate dropped below threshold on LYN_USDT"
./notify.sh "📬 New Fiverr inquiry from user987"
./notify.sh "❌ Garmin watch face API returned 503"
Enter fullscreen mode Exit fullscreen mode

I spent maybe 20 minutes on this. It replaced a monitoring stack I spent days configuring.

Real Examples from My Setup

GPU rental monitor:

# Runs every 30 min
earnings=$(./check_gpu_earnings.sh)
if [ "$earnings" -gt "0" ]; then
  ./notify.sh "💰 GPU earned: $earnings today"
fi
Enter fullscreen mode Exit fullscreen mode

Funding rate watcher:

# Python script, runs every 15 min via cron
rate = get_funding_rate("LYN_USDT")
if rate < -0.5:  # negative = people paying longs
    notify(f"🔥 LYN funding rate: {rate}% — worth checking")
Enter fullscreen mode Exit fullscreen mode

Daily summary (9 AM cron):

#!/bin/bash
msg="📊 Daily Summary — $(date +%Y-%m-%d)

GPU Jobs: $(get_gpu_count) completed
Funding Earned: $(get_funding_total)
Fiverr Inquiries: $(get_fiverr_count)
Watch Face Updates: $(get_garmin_count)

Server uptime: $(uptime -p)"

./notify.sh "$msg"
Enter fullscreen mode Exit fullscreen mode

I wake up, check my phone, and immediately know if anything needs attention. No browser, no VPN, no dashboard.

Part 2: The Command Interface

Outbound alerts are great. But sometimes I want to query the server from my phone.

I wrote a simple Python bot that listens for commands:

import telebot
import subprocess

BOT_TOKEN = "your_token"
ALLOWED_USER = 123456789  # your Telegram user ID

bot = telebot.TeleBot(BOT_TOKEN)

COMMANDS = {
    "/status": "uptime && free -h && df -h /",
    "/gpu": "./check_gpu_status.sh",
    "/funding": "python3 check_funding_rates.py --summary",
    "/services": "ps aux | grep -E '(python|node|ollama)' | grep -v grep",
}

@bot.message_handler(commands=list(COMMANDS.keys()))
def handle_command(message):
    if message.from_user.id != ALLOWED_USER:
        bot.reply_to(message, "Not authorized.")
        return

    cmd_text = message.text.split()[0]  # handle /status@botname format
    if cmd_text in COMMANDS:
        result = subprocess.run(
            COMMANDS[cmd_text], 
            shell=True, 
            capture_output=True, 
            text=True,
            timeout=15
        )
        output = result.stdout[:3000] or result.stderr[:3000] or "No output"
        bot.reply_to(message, f"```
{% endraw %}
\n{output}\n
{% raw %}
```", parse_mode="Markdown")

bot.polling(none_stop=True)
Enter fullscreen mode Exit fullscreen mode

Now from Telegram I can type /status and get:

 11:23:15 up 14 days, 3:41,  1 user
Mem:   16Gi   8.2Gi   7.8Gi
/dev/sda1        245G   82G  163G  34%
Enter fullscreen mode Exit fullscreen mode

Or /funding and get the current rate snapshot.

The key detail: ALLOWED_USER check. Only my Telegram ID can run commands. Everyone else gets "Not authorized." Bot tokens are public in the sense that anyone can message your bot — you need to validate the sender.

Keeping It Running

The command bot needs to stay alive. I use a simple systemd service:

[Unit]
Description=Telegram DevOps Bot
After=network.target

[Service]
ExecStart=/usr/bin/python3 /home/user/telegram-bot/bot.py
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target
Enter fullscreen mode Exit fullscreen mode

systemctl enable telegram-bot && systemctl start telegram-bot — and it survives reboots.

On macOS (my setup) I use a launchd plist, same concept.

What I Actually Get Alerts For

Not everything. Alert fatigue is real.

Alert on:

  • ✅ Job completions (GPU task done, funding cycle closed)
  • ❌ Errors that need action
  • 📬 New customer inquiries (Fiverr inbox)
  • ⚠️ Thresholds crossed (rate drops, disk usage, memory spikes)
  • 📊 Daily summaries (once a day, morning)

Silence:

  • Routine successful runs (no news is good news)
  • Health checks that pass
  • Regular cron completions with no anomalies

The goal is: every message I receive from the bot is something I actually care about. If I'm ignoring 80% of notifications, I'm alerting on the wrong things.

The Full Cost

  • Telegram Bot API: free
  • curl command: comes with your OS
  • Python + telebot library: free
  • Running this bot: negligible CPU, ~20MB RAM

My entire monitoring setup costs $0/month and runs on the same Mac Mini as everything else. No SaaS, no cloud logging, no dashboard subscription.

Three Months Later

I send about 15-20 alerts per day. Daily summary at 9 AM, event-driven messages the rest of the day. I check my phone, see green checkmarks and earnings summaries, and know the server is doing its job.

The one time the GPU host went offline, I got a message within 5 minutes. Fixed it from my phone during lunch.

That's the whole point: not more tooling, just the right interface for how I actually work.


Got a monitoring setup you like? Drop it in the comments — always curious what others are running.

I build these kinds of automation setups on Fiverr
Follow CelebiBots on Telegram

Top comments (0)