Skip to main content

Monitor VPS security with GPT-4 mini analysis via SSH and Telegram alerts

Workflow preview

Workflow preview
100%
Monitor VPS security with GPT-4 mini analysis via SSH and Telegram alerts preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Monitor VPS security with AI analysis via SSH and Telegram alerts This n8n template automatically monitors your VPS for suspicious processes and network connections using AI analysis. It connects t...

Best for

  • SecOps automation workflows
  • AI Summarization automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.scheduletrigger, n8n-nodes-base.ssh, @n8n/n8n-nodes-langchain.chainllm, @n8n/n8n-nodes-langchain.outputparserstructured, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.if, n8n-nodes-base.telegram, n8n-nodes-base.set

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by IranServer.com.

Original n8n.io source

1.1 Workflow description

Title
Monitor VPS security with GPT-4 mini analysis via SSH and Telegram alerts
Workflow name
Monitor VPS security with GPT-4 mini analysis via SSH and Telegram alerts

Monitor VPS security with AI analysis via SSH and Telegram alerts

This n8n template automatically monitors your VPS for suspicious processes and network connections using AI analysis. It connects to your server via SSH, analyzes running processes, and sends Telegram alerts when potential security threats are detected.

Who's it for

  • System administrators managing VPS/dedicated servers
  • DevOps teams monitoring production environments
  • Security-conscious users who want automated threat detection
  • Anyone running services on Linux servers who wants proactive monitoring

How it works

The workflow runs on a scheduled basis and performs the following steps:

  1. SSH Connection: Connects to your VPS via SSH and executes system commands to gather process and network information
  2. Data Collection: Runs ps aux --sort=-%cpu,-%mem && ss -tulpn to capture running processes sorted by CPU/memory usage and active network connections
  3. AI Analysis: Uses OpenAI's language model to analyze the collected data for suspicious patterns, malware signatures, unusual network connections, or abnormal resource usage
  4. Structured Output: Parses AI responses into structured data identifying malicious and suspicious activities with explanations
  5. Alert System: Sends immediate Telegram notifications when malicious processes are detected

Requirements

  • SSH access to your VPS with valid credentials
  • OpenAI API key for AI analysis (uses GPT-4 mini model)
  • Telegram Bot and chat ID for receiving alerts
  • Linux-based VPS or server to monitor

How to set up

  1. Configure SSH credentials: Set up SSH connection to your VPS in the "Execute a command" node
  2. Add OpenAI API key: Configure your OpenAI credentials in the "OpenAI Chat Model" node
  3. Set up Telegram bot:
    • Create a Telegram bot and get the API token
    • Get your Telegram chat ID
    • Update the admin_telegram_id in the "Edit Fields" node with your chat ID
    • Configure Telegram credentials in the "Send a text message" node
  4. Adjust schedule: Modify the "Schedule Trigger" to set your preferred monitoring frequency
  5. Test the workflow: Run a manual execution to ensure all connections work properly

How to customize the workflow

  • Change monitoring frequency: Adjust the schedule trigger interval (hourly, daily, etc.)
  • Modify analysis criteria: Update the AI prompt in "Basic LLM Chain" to focus on specific security concerns
  • Add more commands: Extend the SSH command to include additional system information like disk usage, log entries, or specific service status
  • Multiple servers: Duplicate the SSH execution nodes to monitor multiple VPS instances
  • Different alert channels: Replace or add to Telegram with email, Slack, or Discord notifications
  • Custom filtering: Add conditions to filter out known safe processes or focus on specific suspicious patterns

Good to know

  • The AI model analyzes both running processes and network connections for comprehensive monitoring
  • Each analysis request costs approximately $0.001-0.01 USD depending on system activity
  • The workflow only sends alerts when malicious or suspicious activity is detected, reducing notification noise
  • SSH commands require appropriate permissions on the target server
  • Consider running this workflow from a secure, always-on n8n instance for continuous monitoring

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Schedule Trigger - Every 6 Hours

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 2 - SSH - Gather Process and Network Data

Type / Role
n8n-nodes-base.ssh - ssh
Config choices
Version 1

Block 3 - AI Security Analysis

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.7

Block 4 - Parse Security Analysis Results

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.3

Block 5 - OpenAI GPT-4 Mini Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 6 - Check for Malicious Activity

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 7 - Check for Suspicious Activity

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 8 - Send Malicious Activity Alert

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 9 - Send Suspicious Activity Notice

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 10 - Configuration - User Settings

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 11 - Sticky Note - Main Explanation

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Sticky Note - Step 1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - Sticky Note - Step 2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Sticky Note - Step 3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Monitor VPS security with GPT-4 mini analysis via SSH and Telegram alerts
Complexity intermediate
Nodes 14
Categories SecOps, AI Summarization
Author IranServer.com
Published 21 Sept 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/8792/8792.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Monitor VPS security with GPT-4 mini analysis via SSH and Telegram alerts do?

Monitor VPS security with AI analysis via SSH and Telegram alerts This n8n template automatically monitors your VPS for suspicious processes and network connections using AI analysis. It connects t...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your SecOps, AI Summarization use case.