A lightweight Go service that monitors your VPS stats and sends alert emails when usage thresholds are reached.
- Monitors system usage of your VPS.
- Sends email alerts via SMTP when usage exceeds thresholds.
- Sends a test email on startup to verify SMTP configuration.
- Sends an intialization email for each stat that the watcher is watching for with current system stat reading.
Clone the repository and build the binary or download any of the prebuilt binaries in the releases (Make sure it matches your OS and CPU architecture):
Note: Of the prebuilt binaries only Linux x86_64 is tested on actual hardware (AWS EC2 t2.micro instance)
git clone https://github.com/jelius-sama/VPSWatchDog.git
cd VPSWatchDog
./build.shRun the watchdog with appropriate flags:
./VPSWatchDog \
-smtpHost smtp.example.com \
-smtpPort 587 \
-smtpUser user@example.com \
-smtpPass password \
-from alert@example.com \
-to admin@example.com| Flag | Default | Description |
|---|---|---|
-smtpHost |
smtp.example.com |
SMTP server host |
-smtpPort |
587 |
SMTP server port |
-smtpUser |
user@example.com |
SMTP username |
-smtpPass |
password |
SMTP password |
-from |
alert@example.com |
Sender email address |
-to |
admin@example.com |
Recipient email address |
- On startup, a test email is sent to verify SMTP configuration.
- On startup, each system stat watcher reports an initial reading via email.
- The service checks system usage at the configured interval (configurable in ./cmd/main.go).
- If usage exceeds a threshold, an email alert is sent.
- Go 1.24.5+ (Only to build otherwise binaries in the release section are static and can run without go being installed)
- SMTP credentials with permission to send email
MIT License
