Your VPS is running. Your site is live. But how do you know when something goes wrong? Most server problems don't announce themselves — they creep in silently until a customer emails you saying your site is down, or you wake up to find your database crashed six hours ago.
Automated server monitoring solves this by watching your infrastructure 24/7 and alerting you the moment something needs attention. The best part? You can set up comprehensive monitoring using entirely free tools. This guide walks you through a practical monitoring stack that covers uptime, resources, logs, and alerts.
Why Automated Server Monitoring Matters
Without monitoring, you're flying blind. Here's what can go wrong silently:
- Disk fills up from logs or uploads — database crashes, site goes offline
- Memory leak in your application — performance degrades over hours until the OOM killer strikes
- SSL certificate expires — visitors see security warnings and leave
- CPU spikes from a runaway process — everything slows to a crawl
- Failed backups — you don't find out until you need one
Automated server monitoring catches these issues when they're small problems instead of emergencies. A disk at 80% triggers an alert you can fix in minutes. A disk at 100% means downtime and potential data loss.
The Free Monitoring Stack
Here's what we'll set up, all free:
| Tool | What It Monitors | Alert Method |
|---|---|---|
| UptimeRobot | External uptime and response time | Email, SMS, Slack |
| Netdata | Server resources (CPU, RAM, disk, network) | Email, Slack, Discord |
| Custom scripts | Application-specific checks | Email via cron |
| Logwatch | Daily log summaries | Email digest |
This combination gives you external monitoring (is your site reachable?), internal monitoring (are server resources healthy?), and log analysis (what happened while you weren't looking?).
Step 1: External Uptime Monitoring with UptimeRobot
External monitoring checks your site from outside — the same way your visitors access it. If your server is down, an external monitor catches it even when you can't SSH in.
Set Up UptimeRobot (Free Tier)
- Sign up at uptimerobot.com (free plan: 50 monitors, 5-minute intervals)
- Click "Add New Monitor"
- Configure your monitor:
Monitor Type: HTTP(s)
Friendly Name: My Website
URL: https://yourdomain.com
Monitoring Interval: 5 minutes
- Add alert contacts (email, Slack webhook, or SMS)
- Repeat for any additional endpoints (API, admin panel, staging)
What to Monitor Externally
Don't just monitor your homepage. Set up separate monitors for:
- Main website —
https://yourdomain.com - API endpoint —
https://yourdomain.com/api/health(if applicable) - SSL certificate — UptimeRobot can alert you 30 days before expiration
- Specific pages — your checkout page, login page, or any critical user flow
UptimeRobot checks from multiple locations worldwide, so you'll also catch regional connectivity issues. When your site goes down, you'll get an alert within 5 minutes and a notification when it comes back up.
Step 2: Server Resource Monitoring with Netdata
Netdata is a powerful, free, open-source monitoring agent that gives you real-time visibility into every aspect of your server's health.
Install Netdata
One command installs everything:
curl https://get.netdata.cloud/kickstart.sh > /tmp/netdata-kickstart.sh && sh /tmp/netdata-kickstart.sh
Netdata starts automatically and begins collecting metrics immediately. Access the dashboard at http://your-server-ip:19999.
Secure the Dashboard
By default, Netdata's dashboard is accessible to anyone. Restrict access through your web server. If you're using Nginx as a reverse proxy, add a password-protected location block:
location /netdata/ {
auth_basic "Monitoring";
auth_basic_user_file /etc/nginx/.htpasswd;
proxy_pass http://127.0.0.1:19999/;
proxy_set_header Host $host;
}
Create the password file:
sudo apt install apache2-utils -y
sudo htpasswd -c /etc/nginx/.htpasswd admin
Configure Alerts
Netdata includes hundreds of pre-configured alerts. The most critical ones are enabled by default:
- CPU usage above 90% for 10 minutes
- RAM usage above 90%
- Disk space below 10% free
- Disk I/O latency above threshold
- Network errors and dropped packets
To receive alerts via email, edit /etc/netdata/health_alarm_notify.conf:
# Enable email notifications
SEND_EMAIL="YES"
DEFAULT_RECIPIENT_EMAIL="you@example.com"
For Slack or Discord notifications, Netdata supports webhooks out of the box.
Key Metrics to Watch
After installation, focus on these dashboards:
- System Overview — CPU, RAM, and load average at a glance
- Disk Space — free space per mount point (the silent killer)
- Network — bandwidth usage and connection counts
- Applications — per-process CPU and memory usage
- Web Server — Nginx or Apache request rates and response times
Step 3: Custom Monitoring Scripts
Some things need application-specific checks that off-the-shelf tools don't cover. Simple bash scripts run via cron handle these:
Disk Space Alert Script
#!/bin/bash
# /usr/local/bin/check-disk.sh
THRESHOLD=80
USAGE=$(df / | tail -1 | awk '{print $5}' | sed 's/%//')
if [ "$USAGE" -gt "$THRESHOLD" ]; then
echo "Warning: Disk usage is ${USAGE}% on $(hostname)" | \
mail -s "Disk Alert: $(hostname)" you@example.com
fi
Database Connection Check
#!/bin/bash
# /usr/local/bin/check-db.sh
if ! mysqladmin ping -u monitor -p'password' --silent 2>/dev/null; then
echo "MySQL is not responding on $(hostname)" | \
mail -s "DB Alert: $(hostname)" you@example.com
fi
SSL Expiration Check
#!/bin/bash
# /usr/local/bin/check-ssl.sh
DOMAIN="yourdomain.com"
DAYS_LEFT=$(echo | openssl s_client -connect ${DOMAIN}:443 2>/dev/null | \
openssl x509 -noout -enddate 2>/dev/null | \
cut -d= -f2 | xargs -I{} date -d {} +%s | \
xargs -I{} expr \( {} - $(date +%s) \) / 86400)
if [ "$DAYS_LEFT" -lt 14 ]; then
echo "SSL certificate for ${DOMAIN} expires in ${DAYS_LEFT} days" | \
mail -s "SSL Alert: ${DOMAIN}" you@example.com
fi
Schedule the Scripts
Add them to cron to run at appropriate intervals:
crontab -e
# Disk check every hour
0 * * * * /usr/local/bin/check-disk.sh
# Database check every 5 minutes
*/5 * * * * /usr/local/bin/check-db.sh
# SSL check daily at 9 AM
0 9 * * * /usr/local/bin/check-ssl.sh
Step 4: Log Analysis with Logwatch
Logwatch parses your server logs daily and sends you a summary email. It's the easiest way to spot trends and anomalies without manually reading log files.
Install and Configure
sudo apt install logwatch -y
Configure the daily email in /etc/logwatch/conf/logwatch.conf:
Output = mail
MailTo = you@example.com
MailFrom = logwatch@yourdomain.com
Detail = Med
Range = yesterday
Logwatch runs automatically via a daily cron job. Each morning, you'll receive a summary covering SSH login attempts, web server activity, disk usage changes, package updates, and system errors.
If you see patterns like hundreds of failed SSH attempts from one IP, that's a signal to check your firewall rules and possibly install Fail2ban.
Step 5: Create a Health Check Endpoint
Add a simple health check endpoint to your application that monitoring tools can hit. This tests the full application stack — not just whether the server responds, but whether your app can connect to the database and function properly.
Node.js Example
app.get('/health', async (req, res) => {
try {
await db.query('SELECT 1');
res.json({ status: 'ok', timestamp: new Date().toISOString() });
} catch (err) {
res.status(503).json({ status: 'error', message: 'Database unavailable' });
}
});
PHP/Laravel Example
Route::get('/health', function () {
try {
DB::select('SELECT 1');
return response()->json(['status' => 'ok']);
} catch (\Exception $e) {
return response()->json(['status' => 'error'], 503);
}
});
Point your UptimeRobot monitor at this /health endpoint instead of the homepage. Now you'll know immediately if your database goes down, even if the web server itself is still responding.
Monitoring Checklist
After following this guide, verify you have:
- External uptime monitoring checking your site every 5 minutes
- SSL expiration alerts set up (at least 14 days warning)
- Server resource monitoring (CPU, RAM, disk) with alerts
- Database health checks running every 5 minutes
- Disk space alerts before you hit 90%
- Daily log summaries delivered to your email
- Health check endpoint testing the full application stack
- Alert notifications going to your email or chat tool
FAQ
How much server resources does monitoring use?
Netdata uses approximately 1-2% CPU and 100-150MB of RAM on a typical VPS. UptimeRobot and Logwatch have negligible impact. The resource cost is minimal compared to the problems monitoring prevents.
Should I use Nagios, Zabbix, or Prometheus instead?
For a single VPS or small infrastructure, Netdata plus UptimeRobot is simpler and equally effective. Nagios, Zabbix, and Prometheus are more suited for larger environments with dozens of servers. Start simple and upgrade if your infrastructure grows beyond what these free tools handle.
How quickly will I be alerted when something goes wrong?
UptimeRobot checks every 5 minutes on the free plan. Netdata alerts trigger in real time based on configurable thresholds. Custom cron scripts run at whatever interval you set. For most scenarios, you'll know about problems within 5-10 minutes.
Can I monitor multiple servers with this setup?
Yes. Install Netdata on each server and use Netdata Cloud (free for up to 5 nodes) to see all servers in a single dashboard. UptimeRobot monitors work for any publicly accessible endpoint regardless of which server hosts them.
Monitor with Confidence on DeployBase
Automated server monitoring is essential, but it works best on infrastructure you can trust. At DeployBase, our VPS plans give you full root access to install any monitoring tools you need, plus built-in server health metrics from your hosting dashboard. NVMe SSD storage, 99.9% uptime guarantee, and 24/7 support — starting at $5/month.
Get your VPS at DeployBase → — reliable hosting that's easy to monitor.




