A full-stack server monitoring system built from scratch by a Production Support Engineer.
Monitors Linux server health in real-time and displays metrics on a live web dashboard.
🔗 Live at: monitor-frontend-flame.vercel.app
🔗 Dashboard: monitor-frontend-flame.vercel.app
🔗 API: monitor-api-e8ez.onrender.com/api.php
| Metric | Description |
|---|---|
| CPU Usage | Real-time processor utilization |
| RAM Usage | Memory consumption percentage |
| Disk Usage | Root partition usage |
| Swap Usage | Virtual memory usage |
| Load Average | 1m / 5m / 15m system load |
| Processes | Total running processes |
| Threads | Total active threads |
| IOWait | Disk I/O wait percentage |
| Users | Logged-in user count |
| Uptime | System uptime |
RHEL 8 Server (Agent)
│
│ curl POST (JSON) — every 1 min via cron
▼
PHP REST API (Render.com)
│
│ SQL INSERT
▼
NeonDB (PostgreSQL)
│
│ GET /api.php
▼
Frontend Dashboard (Vercel)
HTML + CSS + JavaScript
| Layer | Technology |
|---|---|
| Agent | Bash Shell Script + Cron Job |
| Backend API | PHP 8.1 — REST API |
| Database | NeonDB (PostgreSQL) |
| Frontend | HTML + CSS + Vanilla JS |
| Deployment | Render.com (API) + Vercel (Frontend) |
| Uptime | UptimeRobot (24/7 monitoring) |
| OS | Red Hat Enterprise Linux 8 |
server-monitor/
├── monitor-agent/
│ ├── monitor.sh # Bash agent — collects metrics
│ └── cleanup.sh # Auto-deletes records older than 7 days
│
├── monitor-api/
│ ├── api.php # PHP REST API
│ ├── Dockerfile # Docker container for Render
│ └── .env.example # Environment variable template
│
└── monitor-frontend/
└── index.html # Dashboard — HTML/CSS/JS
- ✅ Real-time metrics collection via Bash script
- ✅ Automated data collection via Linux Cron Job
- ✅ REST API with API key authentication
- ✅ PostgreSQL database with auto-cleanup (7 days retention)
- ✅ Color-coded gauges (Green / Yellow / Red thresholds)
- ✅ Server Online / Offline detection with banner
- ✅ IST timezone support
- ✅ Fully responsive — Mobile + Tablet + Desktop
- ✅ 24/7 uptime via UptimeRobot keep-alive
- Create free account at neon.tech
- Create new project:
server-monitor - Run this SQL in SQL Editor:
CREATE TABLE servers (
id SERIAL PRIMARY KEY,
hostname VARCHAR(100) UNIQUE NOT NULL,
api_key VARCHAR(64) NOT NULL,
created_at TIMESTAMP DEFAULT NOW()
);
CREATE TABLE metrics (
id SERIAL PRIMARY KEY,
server_id INT REFERENCES servers(id),
cpu_percent NUMERIC(5,2),
ram_percent NUMERIC(5,2),
disk_percent NUMERIC(5,2),
uptime VARCHAR(100),
iowait NUMERIC(5,2) DEFAULT 0,
swap_percent NUMERIC(5,2) DEFAULT 0,
load_1 NUMERIC(5,2) DEFAULT 0,
load_5 NUMERIC(5,2) DEFAULT 0,
load_15 NUMERIC(5,2) DEFAULT 0,
processes INT DEFAULT 0,
threads INT DEFAULT 0,
users INT DEFAULT 0,
recorded_at TIMESTAMP DEFAULT NOW()
);
INSERT INTO servers (hostname, api_key)
VALUES ('your-hostname', 'your-api-key-here');- Fork/clone this repo to your GitHub
- Go to render.com → New Web Service
- Connect your GitHub repo:
monitor-api - Settings:
- Runtime: Docker
- Region: Singapore
- Add Environment Variable:
- Key:
DATABASE_URL - Value: your NeonDB connection string
- Key:
- Click Deploy
# Clone repo
git clone https://github.com/YOUR_USERNAME/monitor-api.git
cd monitor-api
# Edit agent config
nano monitor-agent/monitor.sh
# Set API_URL to your Render URL
# Set API_KEY to match your database entry
# Make executable
chmod +x monitor-agent/monitor.sh
# Test
bash monitor-agent/monitor.sh
# Add cron job (every 1 minute)
crontab -e
# Add: * * * * * bash /path/to/monitor.sh >> /tmp/monitor.log 2>&1- Push
monitor-frontendfolder to GitHub - Go to vercel.com → New Project
- Connect your GitHub repo:
monitor-frontend - Click Deploy — no configuration needed
- Update
APIvariable inindex.htmlto your Render URL
- Go to uptimerobot.com
- Add New Monitor:
- Type: HTTP(s)
- URL:
https://your-api.onrender.com/api.php?ping=1 - Interval: 5 minutes
- Region: Asia
- Save — Render will never sleep again
Create .env file (never commit to GitHub):
| Method | Endpoint | Description |
|---|---|---|
GET |
/api.php |
Fetch latest 20 metrics |
GET |
/api.php?ping=1 |
Health check (UptimeRobot) |
POST |
/api.php |
Submit metrics from agent |
HEAD |
/api.php |
Uptime check |
{
"hostname": "your-server",
"api_key": "your-api-key",
"cpu_percent": 12.5,
"ram_percent": 55.0,
"disk_percent": 25.0,
"swap_percent": 18.0,
"iowait": 0.41,
"load_1": 0.14,
"load_5": 0.36,
"load_15": 0.28,
"processes": 332,
"threads": 803,
"users": 2,
"uptime": "6 hours, 44 minutes"
}Built by Nitin — Production Support Engineer
This project demonstrates hands-on skills in:
- Linux system administration & shell scripting
- REST API development & deployment
- PostgreSQL database design
- Cloud deployment (Render, Vercel, NeonDB)
- Real-time monitoring & alerting concepts
- Docker containerization
- Full-stack web development
- GitHub: @nitinoneview
- Dashboard: monitor-frontend-flame.vercel.app