分钟
Monitor and Alert VPS with Nezha Monitoring

Introduction#

As a VPS user, we often face the following questions:

  • Is the server running normally?
  • How is the traffic usage?
  • Is the server offline?
  • Is the system resource usage reasonable?

Nezha Monitoring is a lightweight server monitoring tool that not only monitors server status in real-time but also sends alert notifications through various methods. This article will detail how to use Nezha Monitoring to monitor and alert VPS, and push alerts via WxPusher.

I. Nezha Monitoring Installation Steps#

1. Preparation#

First, you need to prepare a server as the monitoring panel, the VPS to be monitored, and a domain name pointing to the server IP.

2. Install Docker, Docker-Compose, and NPM Reverse Proxy#

  1. Log in to the monitoring panel server and execute the following command to install Docker, Docker-Compose, and NPM reverse proxy in one click:
Terminal window
sudo apt install git -y && git clone https://github.com/slobys/npm.git && cd npm && chmod +x npm.sh && ./npm.sh
  1. Install the monitoring panel:
Terminal window
curl -L https://raw.githubusercontent.com/nezhahq/scripts/refs/heads/main/install.sh -o nezha.sh && chmod +x nezha.sh && sudo ./nezha.sh

3. Reverse Proxy Configuration#

  1. Open the NPM management panel Access the NPM management panel in the format of server IP: port

  2. Add reverse proxy

[!NOTE] You can skip adding SSL first, select “None” in the SSL section, and access the Nezha panel using HTTP first. After confirming the panel is accessible, you can apply for and add SSL. Some users may encounter internal errors if the default port is not used during NPM installation. You can just press Enter all the way during NPM installation.

4. Install Agent#

  1. Open the Nezha panel via domain name
  2. Click the installation command, paste it into the VPS to be monitored for installation, then refresh the Nezha panel.

II. Monitorable Items#

1. System Status Monitoring#

  • CPU Usage: Monitor CPU load in real-time
  • Memory Usage: Monitor memory usage to avoid insufficient memory
  • Disk Usage: Monitor disk space to prevent service exceptions due to full disk
  • Network Traffic: Monitor inbound and outbound traffic to detect abnormal traffic in time

2. Service Status Monitoring#

  • Website Status: Monitor website accessibility and response time
  • Port Status: Monitor whether specified ports are open
  • Process Status: Monitor whether critical processes are running

3. Network Status Monitoring#

  • Latency Monitoring: Monitor server response time
  • Offline Monitoring: Alert immediately when the server goes offline
  • Network Jitter: Monitor network stability

III. Push Alerts with WxPusher#

1. Register WxPusher Account#

  1. Visit WxPusher Official Website
  2. Register and log in
  3. Create an application to get AppToken

2. Configure Nezha Monitoring Alerts#

  1. Log in to Nezha Monitoring Panel
  2. Go to Alert Settings page
  3. Select WebHook type
  4. Fill in WxPusher’s WebHook address:
    https://wxpusher.zjiecode.com/api/send/message
  5. Configure request body:
    {
    "appToken": "Your AppToken",
    "content": "Server Alert: {{.Title}}\n{{.Content}}",
    "summary": "{{.Title}}",
    "contentType": 1,
    "uids": ["Your User UID"]
    }

3. Configure Alert Rules#

  1. CPU Usage Alert: Alert when CPU usage exceeds 80%
  2. Memory Usage Alert: Alert when memory usage exceeds 85%
  3. Disk Usage Alert: Alert when disk usage exceeds 90%
  4. Network Traffic Alert: Alert when traffic exceeds threshold
  5. Server Offline Alert: Alert immediately when server goes offline

IV. Usage Effects#

1. Real-time Monitoring Panel#

After logging in to Nezha Monitoring Panel, you can see the real-time status of all monitored servers, including:

  • System load
  • Network traffic
  • Service status
  • Historical data charts

2. Alert Notifications#

When an exception occurs on the server, WxPusher will immediately push an alert notification to your WeChat, including:

  • Alert type
  • Alert time
  • Detailed information
  • Server information

3. Data Statistics and Analysis#

Nezha Monitoring also provides rich data statistics functions to help you analyze server running status:

  • Historical load trend
  • Traffic usage statistics
  • Service availability analysis

V. Summary#

Nezha Monitoring is a powerful and easy-to-use server monitoring tool. Through this article, you have learned:

  • How to install and configure Nezha Monitoring
  • How to monitor various VPS metrics
  • How to receive alert notifications via WxPusher

With Nezha Monitoring, you can:

  • Real-time grasp of VPS running status
  • Detect and solve problems in time
  • Avoid business losses caused by server exceptions
  • Optimize server resource usage

Hope this article helps you better manage and monitor your VPS!

VI. Video Tutorial#

Play
Monitor and Alert VPS with Nezha Monitoring
https://jolla.pp.ua/posts/en/how_to_monitor_vps/
作者
NanHuShiJie
发布于
2026-03-08
许可协议
CC BY-NC-SA 4.0