Introduction#
When using something for too long, aesthetic fatigue will occur. Nezha Monitoring has been used for many years and has never let me down. It is easy to set up and the monitoring project is well-organized. The alarm notification is also easily configurable, making it very suitable for ordinary users. However, life is about exploring, and I like to constantly try new things.
I have been interested in the ServerStatus monitoring panel for a long time. It feels too simple and lacks a backend, which is not very user-friendly for beginners. Recently, I discovered the Rust version of ServerStatus cloud probe, which is an enhanced version of ServerStatus
that maintains lightweight and simple deployment. It also supports displaying ping values and packet loss rates for three networks. With this, I can also remove the deployed smokeping.
Setting up ServerStatus-Rust#
Project | Homepage |
---|---|
Github | https://github.com/zdz/ServerStatus-Rust |
Documentation | https://doc.ssr.rs/ |
Quick deployment of the server#
mkdir -p /opt/ServerStatus && cd /opt/ServerStatus
wget --no-check-certificate -qO one-touch.sh ' https://raw.githubusercontent.com/zdz/ServerStatus-Rust/master/one-touch.sh '
bash -ex one-touch.sh
After deployment, open http://127.0.0.1:8080/ or http://:8080/
The server configuration file is located at /opt/ServerStatus/config.toml and can be modified as needed. Reference: https://doc.ssr.rs/rapid_deploy/
One-click deployment of the client#
After setting up your server, please replace ssr.rs
with your own domain name. I use NginxProxyManager to reverse proxy the server IP and also enable SSL.
Different hosts can run the same command to register to the same group.
curl -sSLf "https://ssr.rs/i?pass=pp&gid=g1&alias=$ (hostname)" | bash
Install and enable vnstat, details can be found at https://doc.ssr.rs/vnstat
curl -sSLf "https://ssr.rs/i?pass=pp&gid=g1&vnstat=1&alias=$ (hostname)" | bash
Specify the month rotate as the 7th
curl -sSLf "https://ssr.rs/i?pass=pp&gid=g1&vnstat=1&vnstat-mr=7&alias=$ (hostname)" | bash
Specify location & type (I usually use this)
curl -sSLf "https://ssr.rs/i?pass=pp&gid=g1&alias=$ (hostname)&type=arm&loc=home" | bash
Install and prioritize this VPS
curl -sSLf "https://ssr.rs/i?pass=pp&gid=g1&weight=10000&alias=$ (hostname)" | bash
Customize ping address
curl -sSLf "https://ssr.rs/i?pass=pp&gid=g1&alias=$ (hostname)&cm=cm. Abc. Com: 80" | bash
Debug
curl -sSLf "https://ssr.rs/i?pass=pp&gid=g1&vnstat=0&alias=$ (hostname)" > ssr-client-init. Sh
Bash -x ssr-client-init. Sh
Common ServerStatus commands#
# Start
systemctl start stat_server
systemctl start stat_client
# Check status
systemctl status stat_server
systemctl status stat_client
# Enable auto-start with the following commands
systemctl enable stat_server
systemctl enable stat_client
# Stop
systemctl stop stat_server
systemctl stop stat_client
Telegram Alert Notification#
https://doc.ssr.rs/notification/
# https://core.telegram.org/bots/api
# https://jinja.palletsprojects.com/en/3.0.x/templates/#if
[tgbot]
# Switch, true to enable
Enabled = false
bot_token = "<tg bot token>"
chat_id = "<chat id>"
# Available fields for host can be found in payload.rs file HostStat structure, {{host.xxx}} is a placeholder variable
# For example, host.Name can be replaced with host.Alias. Customize the notification message according to your preferences
# {{ip_info.query}} host IP, {{sys_info.host_name}} host hostname
title = "❗<b>Server Status</b>"
online_tpl = " {{config.title}} \n😆 {{host.location}} {{host.name}} The host is back online"
offline_tpl = " {{config.title}} \n😱 {{host.location}} {{host.name}} The host is offline"
# Leave Custom template empty to disable custom alerts and only keep online/offline notifications
Custom_tpl = """
{% if host.Memory_used / host.Memory_total > 0.5 %}
<pre>😲 {{host.name}} Host memory usage exceeds 50%, currently {{ (100 * host.memory_used / host.memory_total) | round }} % </pre>
{% endif %}
{% if host.Hdd_used / host.Hdd_total > 0.5 %}
<pre>😲 {{host.name}} Host disk usage exceeds 50%, currently {{ (100 * host.hdd_used / host.hdd_total) | round }} % </pre>
{% endif %}
"""