monitoring/health_check/README.md
Monitors FastDFS cluster health and sends alerts when issues are detected.
make
Prerequisites: FastDFS client library, FastCommon library, GCC
./health_checker /etc/fdfs/client.conf [options]
Options:
-d - Run as daemon-i <seconds> - Check interval (default: 30, minimum: 10)Examples:
# Foreground mode with default 30s interval
./health_checker /etc/fdfs/client.conf
# Daemon mode with 60s interval
./health_checker /etc/fdfs/client.conf -d -i 60
Health check results are printed to stdout and logged:
=== FastDFS Cluster Health Check ===
Overall Status: OK
Groups: 2 total, 2 healthy
Storage Servers: 4 total, 4 healthy, 0 warning, 0 critical
Timestamp: Tue Nov 19 21:00:00 2025
=====================================
Alerts are sent to:
Create /etc/systemd/system/fdfs-health-check.service:
[Unit]
Description=FastDFS Health Check Service
After=network.target
[Service]
Type=simple
User=fdfs
ExecStart=/usr/local/bin/health_checker /etc/fdfs/client.conf -d -i 30
Restart=on-failure
[Install]
WantedBy=multi-user.target
Enable and start:
systemctl daemon-reload
systemctl enable fdfs-health-check
systemctl start fdfs-health-check
GPL V3