Project health monitoring system for the dashboard with automatic checks and status history.
February 25, 2026
/backend/health-check.js)Features:
Individual health check functions for each project:
checkPiewell() - Checks piewell.com WordPress JSON APIcheckFuturesScreener() - Checks process and HTTP endpoint on port 3200checkOpenClaw() - Checks gateway process and port 18789checkDashboard() - Self-check (uptime, memory)checkSystem() - CPU/RAM thresholds (warning at 80%, error at 95%)History management:
/home/app/dashboard/data/health-status.jsonResponse format:
{
"project": "piewell",
"status": "healthy|warning|error",
"responseTime": 797,
"lastCheck": "2026-02-25T17:20:13.528Z",
"details": {
"url": "https://piewell.com/wp-json/",
"httpStatus": 200
}
}
POST /api/health/check
GET /api/health/status
GET /api/health/history/:project?hours=24
Implementation:
setIntervalExample Console Output:
[Health Check] Running checks at 2026-02-25T17:20:12.731Z
[Health Check] ๐ข piewell: healthy (797ms)
[Health Check] ๐ข futures-screener: healthy (212ms)
[Health Check] ๐ข openclaw: healthy (223ms)
[Health Check] ๐ก dashboard: warning (0ms)
[Health Check] ๐ข system: healthy (202ms)
[Health Check] Saved 1 history entries
[Auto Health Check] โ ๏ธ Found 1 issue(s):
๐ก dashboard: Unknown issue
/src/components/HealthStatus.tsx)Features:
UI Layout:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ต Health Status [๐ Refresh]โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Healthy Warning Error โ
โ 4 0 0 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ ๐ข Piewell.com โก797ms ๐ 2m ago โ
โ ๐ข Futures Screener โก212ms ๐ 2m ago โ
โ ๐ข OpenClaw โก223ms ๐ 2m ago โ
โ ๐ข Dashboard โก0ms ๐ 2m ago โ
โ ๐ข System โก202ms ๐ 2m ago โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Last updated: 2m ago โข Auto-refresh every 5 min โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
File: /home/app/dashboard/data/health-status.json
Structure:
{
"history": [
{
"timestamp": "2026-02-25T17:20:13.531Z",
"checks": [
{
"project": "piewell",
"status": "healthy",
"responseTime": 797,
"lastCheck": "2026-02-25T17:20:13.528Z",
"details": { ... }
}
]
}
],
"lastUpdate": "2026-02-25T17:20:13.531Z"
}
https://piewell.com/wp-json/http://localhost:3200/$ curl -X POST http://localhost:3000/api/health/check
{
"status": "success",
"timestamp": "2026-02-25T17:21:45.123Z",
"checks": [ ... 5 projects ... ]
}
$ curl http://localhost:3000/api/health/status
{
"status": "ok",
"timestamp": "2026-02-25T17:20:13.531Z",
"checks": [ ... latest results ... ]
}
$ curl "http://localhost:3000/api/health/history/piewell?hours=1"
{
"project": "piewell",
"hours": 1,
"history": [ ... 2 entries ... ],
"count": 2
}
npm run build/src/types/index.ts/home/app/dashboard/data/health-status.jsonCreated:
/home/app/dashboard/backend/health-check.js (13.6 KB)/home/app/dashboard/src/components/HealthStatus.tsx (7.8 KB)/home/app/dashboard/data/health-status.json (3.4 KB, auto-generated)/home/app/dashboard/HEALTH_MONITORING.md (this file)Modified:
/home/app/dashboard/backend/index.js - Added health endpoints and auto-check/home/app/dashboard/src/App.tsx - Added HealthStatus component/home/app/dashboard/src/types/index.ts - Added HealthCheck and HealthStatus typesBackend:
pm2 restart dashboard
Frontend:
cd /home/app/dashboard
npm run build
Verify:
# Check backend is running
curl http://localhost:3000/api/health/status
# Check PM2 logs
pm2 logs dashboard --lines 50
Health Data Cleanup:
/home/app/dashboard/data/health-status.json to resetLogs:
# View health check logs
pm2 logs dashboard | grep "Health Check"
# Filter for errors only
pm2 logs dashboard | grep "๐ด\|๐ก"
Troubleshooting:
pm2 restart dashboardTypical Response Times (from test run):
HTTP Status Codes:
200 OK - Health check successful500 Internal Server Error - Health check failedHealth Statuses:
healthy - All checks passedwarning - Degraded performance (above thresholds but not critical)error - Service unavailable or critical thresholds exceededno_data - No health checks run yetThe HealthStatus component is integrated at the top of the dashboard, above the project cards. It provides a quick overview of all project statuses before diving into individual KPIs.
Visual Hierarchy:
This placement ensures health issues are immediately visible when loading the dashboard.
Task ID: task-db2
Status: โ
Complete
Completion Date: February 25, 2026
Estimated Time: 90 minutes
Actual Time: ~75 minutes