Open-source server monitoring for KVM, OpenVZ, Virtuozzo, Docker, LXC, and cPanel
Self-hosted alternative to Datadog/New Relic. Monitor servers, containers, databases, web servers, and mail servers with Prometheus, Grafana, intelligent alerting, and ML anomaly detection.
Features • Quick Start • Architecture • Docs • Contributing
- Real-time System Monitoring — CPU, memory, disk, network, and load average with live WebSocket updates
- Multi-platform Containers — OpenVZ, KVM/libvirt, Virtuozzo, Docker, and LXC container management with storage pool and network traffic tracking
- LVM/Disk Monitoring — Volume group tracking, partition free space, and disk pressure handling
- Uptime Monitoring — HTTP/HTTPS, TCP, ICMP (ping), and DNS checks with response time tracking and keyword matching
- Log Aggregation — Centralized log storage and querying via Loki + Promtail
- Intelligent Alerting — PromQL-based alert rules with dual thresholds (warning + critical), hysteresis, and multi-stage evaluation
- 6 Notification Channels — Slack (with interactive buttons), Telegram, Email (SMTP), Discord, Webhooks, and PagerDuty
- Slack Interactions — Acknowledge, silence, or create incidents directly from Slack notification buttons
- Alert Reconciliation — Auto-resolves stale alerts missed by AlertManager
- Maintenance Windows — Suppress alerts during scheduled maintenance
- Anomaly Detection — ML-based scoring using K-means clustering with automatic model retraining and configurable sensitivity per server
- Forecasting — Linear regression-based disk and resource usage trend prediction with 30-day projections
- Daily Infrastructure Reports — Automated Slack/Telegram summaries with VM counts, stopped containers, disk usage, and mail server stats
- Incident Management — Create, track, and resolve incidents with status workflow (Investigating → Identified → Monitoring → Resolved) and timeline updates
- Custom Dashboards — Build and share dashboards with PromQL-powered panels
- 14 Pre-built Grafana Dashboards — System overview, API metrics, containers, server details, MySQL, PostgreSQL, MongoDB, Nginx, Apache, LiteSpeed, Exim, cPanel, network traffic, and anomaly detection
- Audit Logging — Tracks all admin actions (server changes, alert rules, user roles, incident updates)
- Automated Housekeeping — Configurable retention policies with disk pressure-aware cleanup and PostgreSQL VACUUM
- Database Backups — Automated pg_dump with gzip compression, configurable schedule and retention
- JWT Authentication — Role-based access control (Admin/User) with configurable token expiry
- Reverse Proxy — Nginx with rate limiting, security headers (X-Frame-Options, CSP, XSS protection), and gzip compression
- SSL/TLS Ready — Let's Encrypt ACME support with certificate configuration
- Slack Signature Verification — HMAC-SHA256 request validation for webhook security
- Ubuntu/Debian Linux (tested on Ubuntu 22.04/24.04, Debian 12)
- 2+ CPU cores, 4GB+ RAM recommended
curl -sL https://raw.githubusercontent.com/digin1/NodePrism/main/deploy.sh | sudo bashThis installs Docker, Node.js 20, pnpm, PM2, clones the repo, configures .env (auto-detects server IP, generates JWT secret), starts all infrastructure containers, builds and launches the app with PM2.
# Clone the repository
git clone https://github.com/digin1/NodePrism.git
cd NodePrism
# Copy env file and configure
cp .env.example .env
# Edit .env — set SERVER_IP to your server's public IP
# Initialize Prometheus config files
bash infrastructure/docker/init-prometheus.sh
# Symlink .env for Docker Compose
ln -sf "$(pwd)/.env" infrastructure/docker/.env
# Install dependencies
pnpm install
# Start infrastructure services (PostgreSQL, Redis, Prometheus, etc.)
pnpm docker:up
# Build and start the application with PM2
pnpm run build && pnpm run start:pm2| Service | URL | Credentials |
|---|---|---|
| Web UI | http://<server-ip>:3000 |
Register on first visit |
| Grafana | http://<server-ip>:3000/grafana/ |
admin / admin |
| Prometheus | http://<server-ip>:3000/prometheus/ |
— |
| AlertManager | http://<server-ip>:3000/alertmanager/ |
— |
| API | http://<server-ip>:4000 |
— |
| Documentation | Online docs | — |
Grafana, Prometheus, and AlertManager are proxied through the Web UI on port 3000 — session-authenticated and accessible from a single origin.
Install the NodePrism agent on any server you want to monitor:
curl -sL http://<nodeprism-ip>:3000/agent-install.sh | sudo bashThe agent auto-registers with the manager and begins shipping metrics, container stats, and logs.
Supported agent/exporter types:
| Agent | Port | What it monitors |
|---|---|---|
| Node Exporter | 9100 | CPU, memory, disk, network, load |
| App Agent | 9101 | Custom application metrics |
| MySQL Exporter | 9104 | MySQL/MariaDB databases |
| Nginx Exporter | 9113 | Nginx web server |
| Apache Exporter | 9117 | Apache web server |
| PostgreSQL Exporter | 9187 | PostgreSQL databases |
| MongoDB Exporter | 9216 | MongoDB databases |
| Redis Exporter | — | Redis instances |
| Libvirt Exporter | — | KVM/libvirt virtual machines |
| LiteSpeed Exporter | — | LiteSpeed web server |
| Exim Exporter | — | Exim mail server |
| cPanel Exporter | — | cPanel/WHM hosting panels |
| Promtail | 9080 | Log shipping to Loki |
- Metrics — Prometheus scrapes exporters on remote servers via file-based service discovery (target files generated by Config Sync)
- Agents — Remote agents POST to
/api/agents/register, then send heartbeats every 30s - Alerts — Prometheus fires rules → AlertManager → webhook to API → notifications (Slack/Telegram/Email/Discord/Webhook/PagerDuty) + Socket.IO events
- Anomaly Detection — Queries Prometheus for 4-hour windows, trains K-means models (Redis), scores every 10s
- Logs — Promtail ships logs to Loki, queryable through Grafana
- Proxy — Grafana, Prometheus, AlertManager bind to 127.0.0.1 only, proxied through Next.js :3000 with session auth
| Service | Port | Role |
|---|---|---|
| Web UI | :3000 | Next.js dashboard, proxies monitoring tools |
| API | :4000 | REST API, Socket.IO, webhook handlers, Prisma ORM |
| Config Sync | :4002 | Generates Prometheus targets from DB, syncs status back |
| Anomaly Detector | :4003 | ML pipeline — trains K-means models, scores metrics |
| Agent | :9101 | Runs on each server, exposes /metrics, sends heartbeats |
NodePrism/
├── packages/
│ ├── web/ # Next.js 14 — Management UI
│ ├── api/ # Express — REST API + Socket.IO + Prisma
│ ├── config-sync/ # Prometheus target & status sync worker
│ ├── anomaly-detector/ # K-means clustering anomaly detection
│ ├── agent-app/ # Remote server monitoring agent
│ └── shared/ # Shared TypeScript types & Zod schemas
│
├── infrastructure/
│ └── docker/ # Docker Compose + service configs
│ ├── prometheus/ # Prometheus config, alert rules, targets
│ ├── grafana/ # Datasources + 14 pre-built dashboards
│ ├── alertmanager/ # Alert routing config
│ ├── loki/ # Log aggregation config
│ └── nginx/ # Reverse proxy with rate limiting & security
│
├── docs-site/ # Docusaurus documentation site
├── scripts/ # Setup, cert generation, agent download scripts
├── deploy.sh # One-line deployment script
└── ecosystem.config.js # PM2 production process config
| Layer | Technologies |
|---|---|
| Frontend | Next.js 14, React 18, TanStack Query, Tailwind CSS, Recharts, Socket.IO Client |
| Backend | Node.js, Express, Socket.IO, Prisma ORM, Zod |
| Database | PostgreSQL 15, Redis 7 |
| Monitoring | Prometheus, Grafana, Loki, AlertManager, Pushgateway |
| ML | simple-statistics, ml-kmeans (anomaly detection & forecasting) |
| Infrastructure | Docker Compose, PM2, Nginx, Turborepo, pnpm workspaces |
| Language | TypeScript (strict mode) |
NodePrism runs 5 services managed by PM2 with auto-restart, memory limits, and systemd boot persistence:
| Service | Memory Limit | Purpose |
|---|---|---|
| nodeprism-api | 500 MB | REST API + WebSocket gateway |
| nodeprism-web | 500 MB | Next.js frontend |
| nodeprism-config-sync | 300 MB | Prometheus target sync |
| nodeprism-anomaly-detector | 768 MB | ML anomaly pipeline |
| nodeprism-agent | 200 MB | Local agent (manager node) |
pnpm run build && pnpm run start:pm2 # Build and start all services
pnpm run status:pm2 # Check service status
pnpm run logs:pm2 # Tail all logs
pnpm run stop:pm2 # Stop all services
pnpm run restart:pm2 # Restart all servicesCopy .env.example to .env and configure. Key settings:
| Variable | Default | Description |
|---|---|---|
SERVER_IP |
— | Your server's public IP (required) |
JWT_SECRET |
— | Random string for token signing (required) |
DB_PASSWORD |
nodeprism123 |
PostgreSQL password |
GRAFANA_PASSWORD |
admin123 |
Grafana admin password |
DAILY_REPORT_TIME |
08:00 |
When to send daily reports |
BACKUP_SCHEDULE_HOURS |
24 |
Database backup interval |
BACKUP_RETENTION_COUNT |
7 |
Number of backups to keep |
See .env.example for all 60+ configuration options.
# Development mode (hot reload)
pnpm run dev
# Run tests (725 tests across 36 suites)
pnpm test
# Run tests with coverage
pnpm test:coverage
# Lint all packages
pnpm lint
# Format code
pnpm formatpnpm docker:up # Start all infrastructure services
pnpm docker:down # Stop all services
pnpm docker:logs # View logsFull documentation is available online and locally:
- Online: https://digin1.github.io/NodePrism/
- Local:
http://localhost:3080when running the docs container
Topics covered: architecture, API reference, database schema, deployment, monitoring & alerting setup, and agent configuration.
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/my-feature) - Commit your changes (
git commit -m 'Add my feature') - Push to the branch (
git push origin feature/my-feature) - Open a Pull Request
This software is provided "as is" and at your own risk. The authors and contributors are not responsible for any data loss, system downtime, security breaches, or any other damages resulting from the use of this software. You are solely responsible for maintaining backups, evaluating suitability for your environment, and ensuring proper security configurations. Use in production is at your own discretion and risk.
This project is licensed under the MIT License — see the LICENSE file for details.

