⚙️ Proxmox system monitor - VM status, host resources & temperature alerts via Telegram

1,727 views · ⚙️ DevOps & CI/CD

Description

Setup Instructions

Overview

This n8n workflow monitors your Proxmox VE server and sends automated reports to Telegram every 15 minutes. It tracks VM status, host resource usage, temperature sensors, and detects recently stopped VMs.

Prerequisites

Required Software

Required Access

Installation Steps

Step 1: Install Temperature Sensors on Proxmox

SSH into your Proxmox server and run:

apt-get update
apt-get install -y lm-sensors
sensors-detect

Press ENTER to accept default answers during sensors-detect setup.

Test that sensors work:

sensors | grep -E 'Package|Core'

Step 2: Create Telegram Bot

  1. Open Telegram and search for BotFather
  2. Send /newbot command
  3. Follow prompts to create your bot
  4. Save the API token provided
  5. Get your Chat ID by sending a message to your bot, then visiting:
    https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates
  6. Look for “chat”:{“id”: YOUR_CHAT_ID in the response

Step 3: Configure n8n Credentials

SSH Password Credential

  1. In n8n, go to Credentials menu
  2. Create new credential: SSH Password
  3. Enter:
    • Host: Your Proxmox IP address
    • Port: 22
    • Username: root (or your admin user)
    • Password: Your Proxmox password

Telegram API Credential

  1. Create new credential: Telegram API
  2. Enter the Bot Token from BotFather

Step 4: Import and Configure Workflow

  1. Import the JSON workflow into n8n

  2. Open the “Set Variables” node

  3. Update the following values:

    • PROXMOX_IP: Your Proxmox server IP address
    • PROXMOX_PORT: API port (default: 8006)
    • PROXMOX_NODE: Node name (default: pve)
    • TELEGRAM_CHAT_ID: Your Telegram chat ID
    • PROXMOX_USER: Proxmox username with realm (e.g., root@pam)
    • PROXMOX_PASSWORD: Proxmox password
  4. Connect credentials:

    • SSH - Get Sensors node: Select your SSH credential
    • Send Telegram Report node: Select your Telegram credential
  5. Save the workflow

  6. Activate the workflow

Configuration Options

Adjust Monitoring Interval

Edit the “Schedule Every 15min” node:

Adjust Recently Stopped VM Detection Window

Edit the “Process Data” node:

Modify Temperature Warning Threshold

The workflow uses the “high” threshold defined by sensors. To manually set threshold, edit “Process Data” node:

Testing

Test Individual Components

  1. Execute “Set Variables” node manually - verify output
  2. Execute “Proxmox Login” node - check for valid ticket
  3. Execute “API - VM List” - confirm VM data received
  4. Execute complete workflow - check Telegram for message

Troubleshooting

Login fails:

No temperature data:

Recently stopped VMs not detected:

Telegram not receiving messages:


How It Works

Workflow Architecture

The workflow executes in a sequential chain of nodes that gather data from multiple sources, process it, and deliver a formatted report.

Execution Flow

Schedule Trigger (15min)
  - Set Variables
  - Proxmox Login (get authentication ticket)
  - Prepare Auth (prepare credentials for API calls)
  - API - VM List (get all VMs and their status)
  - API - Node Tasks (get recent task log)
  - API - Node Status (get host CPU, memory, uptime)
  - SSH - Get Sensors (get temperature data)
  - Process Data (analyze and structure all data)
  - Generate Formatted Message (create Telegram message)
  - Send Telegram Report (deliver via Telegram)

Data Collection

VM Information (Proxmox API)

Endpoint: /api2/json/nodes/{node}/qemu

Retrieves:

Task Log (Proxmox API)

Endpoint: /api2/json/nodes/{node}/tasks?limit=100

Retrieves recent tasks to detect:

Host Status (Proxmox API)

Endpoint: /api2/json/nodes/{node}/status

Retrieves:

Temperature Data (SSH)

Command: sensors | grep -E 'Package|Core'

Retrieves:

Data Processing

VM Status Analysis

  1. Counts total, running, and stopped VMs
  2. Queries task log for stop/shutdown operations
  3. Filters tasks within 15-minute window
  4. Extracts VM ID from task UPID string
  5. Matches VM ID to VM name from VM list
  6. Calculates time elapsed since stop operation

Temperature Intelligence

The workflow implements smart temperature reporting:

Normal Operation (all temps below high threshold):

Warning State (any temp at or above high threshold):

Resource Calculation

CPU Usage:

Memory:

Uptime:

Report Generation

Message Structure

The Telegram message uses HTML formatting for structure:

  1. Header Section

    • Report title
    • Generation timestamp
  2. Virtual Machines Section

    • Total VM count
    • Running VMs with checkmark
    • Stopped VMs with stop sign
    • Recently stopped count with warning
    • Detailed list if VMs stopped in last 15 minutes
  3. Host Resources Section

    • CPU usage percentage
    • Memory used/total with percentage
    • Host uptime in days and hours
  4. Temperature Section

    • Smart display (summary or detailed)
    • Warning indicator if thresholds exceeded
    • Monospace formatting for sensor output

HTML Formatting Features

Security Considerations

Credential Storage

API Communication

SSH Access

Performance Impact

API Load

Execution Time

Typical workflow execution: 5-10 seconds

Resource Usage

Extensibility

Adding Additional Metrics

To monitor additional data points:

  1. Add new API call node after “Prepare Auth”
  2. Update “Process Data” node to include new data
  3. Modify “Generate Formatted Message” for display

Integration with Other Services

The workflow can be extended to:

Multi-Node Monitoring

To monitor multiple Proxmox nodes:

  1. Duplicate API call nodes
  2. Update node names in URLs
  3. Merge data in processing step
  4. Generate combined report

🔗 Nodes Used

HTTP Request, Telegram, SSH, Schedule Trigger

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup