img creating a telegram bot for proxmox notifications proxmox monitoring

Creating a Telegram bot for Proxmox notifications

How to Set Up Telegram Alerts for Monitoring Your Proxmox Cluster

I’ll show a practical way to get Telegram notifications from your Proxmox cluster. You will create a Telegram bot, get a chat id, test a simple send, then pick a method to forward real Proxmox events. I give concrete commands, a tiny script you can copy, and configuration tips so alerts do not flood your phone.

Step-by-step guide to setting up Proxmox monitoring with Telegram

Preparing your Proxmox environment for notifications

Make sure your Proxmox host can reach api.telegram.org on port 443. Open outgoing HTTPS if you run a strict firewall. Create a dedicated service account or use root with an API token for automation access to the Proxmox API. If you prefer not to touch the API, plan to read logs instead; both approaches work for Proxmox monitoring.

Give the automation account only the minimum privileges it needs. For example, a read-only role that can view tasks, node status and backup logs is usually enough.

Creating your Telegram bot and getting the API token

  1. In Telegram chat with @BotFather.
  2. Send /newbot and follow prompts for name and username.
  3. BotFather returns a token that looks like 123456:ABC-defGhIJKlmnoPQRstuVwxYZ.

Get the chat id. Add the bot to a group or start a direct chat with it. Then run:
curl -s “https://api.telegram.org/bot/getUpdates” | jq .
Look for message.chat.id in the JSON. That number is your CHAT_ID.

Test sending a message:
curl -s -X POST “https://api.telegram.org/bot/sendMessage” \
-d chat_id= \
-d text=”Telegram notifications test from Proxmox monitoring”

Replace and . If the message arrives, the bot and network are working.

Configuring Proxmox webhook notifications

There are three practical ways to feed Proxmox events into Telegram:

Option A — direct webhook bridge (recommended for small setups)

  • Run a tiny HTTP endpoint or script that accepts a POST from Proxmox or another monitor and forwards it to Telegram with curl.
  • Example minimal forwarder (bash). Save as /usr/local/bin/telegram-forward.sh and chmod +x it:

!/bin/bash

TOKEN=”123456:ABC-DEF”
CHATID=”987654321″
TEXT=”$1″
curl -s -X POST “https://api.telegram.org/bot${TOKEN}/sendMessage” \
-d chat
id=”${CHAT_ID}” \
-d text=”$(echo “$TEXT” | cut -c1-4000)”

Use Proxmox to call that script, or configure a small webhook receiver on a separate host that accepts JSON and calls this script. This approach is simple to understand and quick to test.

Option B — tail logs and match

  • Tail /var/log/syslog or the Proxmox task log and match strings for critical events.
  • Example one-liner:
    tail -F /var/log/syslog | \
    grep –line-buffered -Ei ‘error|panic|failed|lost quorum’ | \
    while read -r line; do /usr/local/bin/telegram-forward.sh “$line”; done

This is quick to deploy but will need fine tuning to avoid noise.

Option C — external monitoring tools

  • Run Prometheus with node_exporter and Alertmanager, or use Uptime Kuma, Nagios, Centreon.
  • Alertmanager can route alerts to Telegram through a webhook or a small bridge. External monitoring gives history, silencing and grouping for better Proxmox alerts.

Choose the option that matches your appetite for maintenance. I prefer a small bridge for homelabs and Alertmanager for larger setups.

Testing notifications from Proxmox

Trigger a safe test. Examples:

  • A deliberate VM stop or restart.
  • A temporary firewall block on a node to simulate node down.
  • A simulated failed backup or a test log line injected to /var/log/syslog.

Use the same curl sendMessage command to simulate how real alerts will appear. Confirm timestamps, VM names and node names are included in the message so you know what to act on.

Exploring external monitoring tools for Proxmox alerts

If you need alert history, dashboards or fancy routing, pick one of these:

  • Prometheus + Alertmanager for metric-based alerts and grouping.
  • Uptime Kuma for simple HTTP/ICMP checks and Telegram notifications.
  • Nagios or Centreon if you prefer classical monitoring.

I use Prometheus when I want thresholds and deduplication. Uptime Kuma is great for quick availability checks and has a built-in Telegram notifier.

Tips for effective Proxmox alerts and Telegram notifications

Keeping alert volume manageable

High volume kills usefulness. Send only high-value alerts:

  • Node offline or lost quorum.
  • Backup failure.
  • Storage near full (I use 85% as a trigger).
  • VM process crashes or repeated failed starts.

Group similar events. If three backups fail at once, send one grouped message listing each VM. Set a rolling suppression window so repeated noise about the same issue is suppressed for 10–30 minutes.

Customizing alert messages

Add the essentials: severity, node, VM name, short description, timestamp, and a link to the Proxmox web UI (https://proxmox.example:8006). Keep messages short. Example format:
CRITICAL: backup failed
Node: pve1
VM: vm-105 (plex)
When: 2025-10-26T09:04:12Z

If you use Alertmanager, use templates to format the message and include labels like severity and team_owner.

Integrating with automation tools for better management

Use n8n or a small script to parse incoming webhooks and add context:

  • Enrich alerts with runbook links.
  • Auto-create an incident ticket in a ticketing system.
  • Add quick action buttons in Telegram via inline keyboards if you need restart controls.

I use automation sparingly. Keep human approval for destructive actions.

Monitoring Proxmox cluster health effectively

Track these metrics:

  • Cluster quorum state.
  • Node CPU and memory usage spikes.
  • Disk usage per storage (LVM, ZFS).
  • I/O wait and disk errors.
  • Backup job status and duration.

Set thresholds and alert only on sustained breaches, not single spikes. For example, alarm on disk > 85% for more than 30 minutes.

Troubleshooting common notification issues

Bot not sending messages:

  • Confirm bot is added to the chat or invited into the group.
  • Check getUpdates for errors.
  • Check firewall for blocked outbound HTTPS.

Wrong chat id:

  • Use getUpdates again after sending a message to the bot from the target chat. Chat ids change for group chats if new security features are applied.

Too many messages:

  • Add filters or rate limits in the bridge.
  • Use Alertmanager grouping or a dedupe window.

Missing context:

  • Include node and VM identifiers in the message. If your alerts only send error codes, add a lookup that resolves IDs to human names.
  • Create the Telegram bot, get the token and chat id. Test with curl.
  • Start with a simple bridge or log tailer to forward only critical Proxmox alerts.
  • If you need history and dedup, add Prometheus + Alertmanager or Uptime Kuma.
  • Tune thresholds and grouping so Telegram notifications remain useful.

This gives you a working Proxmox monitoring path with Telegram notifications.

Leave a Reply

Your email address will not be published. Required fields are marked *

Prev
Logitech G G29 SE Driving Force Racing Wheel + 2 more Amazon tech bargains
weekly deals

Logitech G G29 SE Driving Force Racing Wheel + 2 more Amazon tech bargains

Discover the Logitech G G29 SE Racing Wheel and more in this week's Amazon deals

Next
n8n | n8n@1.117.2
n8n n8n1 117 2

n8n | n8n@1.117.2

n8n version 1

You May Also Like