📊 Server Monitor / 服务器监控
Monitor your server: CPU, memory, disk, network, and services. Set up alerts and dashboards. 监控你的服务器:CPU、内存、磁盘、网络和服务。配置告警和仪表板。
Quick Checks / 快速检查
# CPU & Memory
htop # Interactive / 交互式
ps aux --sort=-%cpu | head -10 # Top CPU processes / CPU前10
ps aux --sort=-%mem | head -10 # Top memory / 内存前10
# Disk / 磁盘
df -h # Usage / 使用率
du -sh /* | sort -rh | head -10 # Top directories / 大目录排行
# Network / 网络
ss -tlnp # Listening ports / 监听端口
iftop # Real-time traffic / 实时流量
# System / 系统
uptime # Uptime + load / 运行时间+负载
journalctl -xe -n 20 # Recent logs / 最近日志
One-Click Monitoring / 一行装监控
Netdata
bash <(curl -Ss https://my-netdata.io/kickstart.sh)
# Access: http://YOUR_IP:19999
Uptime Kuma (Docker)
version: '3'
services:
uptime-kuma:
image: louislam/uptime-kuma:1
ports:
- "3001:3001"
volumes:
- ./data:/app/data
restart: always
Alert Script / 告警脚本
#!/bin/bash
THRESHOLD=90
df -h | grep -vE '^Filesystem|tmpfs' | awk '{print $5 " " $1}' | while read line
do
usep=$(echo $line | awk '{print $1}' | cut -d'%' -f1)
part=$(echo $line | awk '{print $2}')
if [ $usep -ge $THRESHOLD ]; then
echo "⚠️ WARNING: Partition $part is ${usep}% full"
fi
done
Log Analysis / 日志分析
# Top IPs / 访问最多的IP
awk '{print $1}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head -10
# Status codes / 状态码统计
awk '{print $9}' /var/log/nginx/access.log | sort | uniq -c | sort -rn
# Real-time monitoring / 实时监控
tail -f /var/log/nginx/access.log | awk '{print $1, $7, $9}'
📞 Contact / 联系方式
QQ: 3292957
Email: snowdu@gmail.com
QR Code: see
assets/qr-contact.pngin this package 微信/QQ 二维码见本技能包assets/qr-contact.png文件
For paid services / 需要付费服务请直接联系
