A lightweight, real-time multi-agent server monitoring system with a modern web dashboard. Monitor CPU, memory, disk usage, processes, and Docker containers across multiple servers from a single interface.

┌─────────────────┐ WebSocket/HTTP ┌──────────────────┐
│ Web Browser │ ◄─────────────────► │ Home Server │
└─────────────────┘ └──────────────────┘
▲
│ HTTP API
┌────────┼────────┐
│ │
┌────▼───┐ ┌────▼───┐
│ Agent1 │ │ Agent2 │
└────────┘ └────────┘
Create a docker-compose.yml file:
services:
home-server:
image: hhftechnology/vps-monitor-home:latest
container_name: vps_monitor_home
ports:
- "8085:8085"
environment:
- GIN_MODE=release
restart: unless-stopped
deploy:
resources:
limits:
cpus: '0.5'
memory: 128M
reservations:
cpus: '0.1'
memory: 32M
agent:
image: hhftechnology/vps-monitor-agent:latest
container_name: vps_monitor_agent_local
# Required for accessing host processes and Docker
privileged: true
volumes:
# Docker socket for container stats
- /var/run/docker.sock:/var/run/docker.sock:ro
# Host filesystem for process information
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /dev:/host/dev:ro
- /etc/os-release:/host/etc/os-release:ro
# Host root filesystem for disk usage
- /:/host/root:ro
user: "root"
environment:
- HOME_SERVER_URL=http://home-server:8085
- AGENT_NAME=Local-Server
# Tell agent where to find host proc
- HOST_PROC=/host/proc
- HOST_SYS=/host/sys
- HOST_ROOT=/host/root
restart: unless-stopped
deploy:
resources:
limits:
cpus: '0.2'
memory: 64M
reservations:
cpus: '0.05'
memory: 16M
# Start the monitoring system
docker compose up -d
# View logs
docker compose logs -f
# Stop the system
docker compose down
Open your browser and navigate to: http://your-server-ip:8085
| Variable | Default | Description |
|---|---|---|
GIN_MODE | debug | Gin framework mode (release for production) |
PORT | 8085 | Server listening port |
| Variable | Default | Description |
|---|---|---|
HOME_SERVER_URL | Required | URL of the home server (e.g., http://192.168.1.100:8085) |
AGENT_NAME | hostname | Friendly name for the agent |
AGENT_ID | hostname | Unique identifier for the agent |
HOST_PROC | /host/proc | Path to host proc filesystem |
HOST_SYS | /host/sys | Path to host sys filesystem |
HOST_ROOT | /host/root | Path to host root filesystem |
To monitor multiple servers, deploy agents on each target server:
# Use the complete docker-compose.yml above
services:
agent:
image: hhftechnology/vps-monitor-agent:latest
container_name: vps_monitor_agent_server2
privileged: true
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /dev:/host/dev:ro
- /etc/os-release:/host/etc/os-release:ro
- /:/host/root:ro
environment:
- HOME_SERVER_URL=http://192.168.1.100:8085 # IP of home server
- AGENT_NAME=Production-Server-2
- HOST_PROC=/host/proc
- HOST_SYS=/host/sys
- HOST_ROOT=/host/root
user: "root"
restart: unless-stopped
deploy:
resources:
limits:
cpus: '0.2'
memory: 64M
services:
agent:
image: hhftechnology/vps-monitor-agent:latest
container_name: vps_monitor_agent_server3
privileged: true
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /dev:/host/dev:ro
- /etc/os-release:/host/etc/os-release:ro
- /:/host/root:ro
environment:
- HOME_SERVER_URL=http://192.168.1.100:8085 # IP of home server
- AGENT_NAME=Database-Server
- HOST_PROC=/host/proc
- HOST_SYS=/host/sys
- HOST_ROOT=/host/root
restart: unless-stopped
user: "root"
deploy:
resources:
limits:
cpus: '0.2'
memory: 64M
/proc, /sys, and /dev# Use specific network for isolation
docker network create vps-monitor
# Limit agent resource usage
# (Already configured in compose files above)
# Use environment files for sensitive data
# Create .env file:
echo "HOME_SERVER_URL=http://your-home-server:8085" > .env
Check agent logs:
docker logs vps_monitor_agent_local
Verify connectivity:
# From agent server, test home server connectivity
curl http://your-home-server:8085/api/health
Check environment variables:
docker exec vps_monitor_agent_local env | grep HOME_SERVER_URL
If processes aren't showing:
# Ensure privileged mode is enabled
docker inspect vps_monitor_agent_local | grep Privileged
# Check volume mounts
docker inspect vps_monitor_agent_local | grep Mounts -A 20
# Verify Docker socket access
docker exec vps_monitor_agent_local docker ps
# Check socket permissions
ls -la /var/run/docker.sock
# Clone repository
git clone https://github.com/your-username/vps-monitor.git
cd vps-monitor
# Build home server
cd home
docker build -t vps-monitor-home:local .
# Build agent
cd ../agent
docker build -t vps-monitor-agent:local .
# Use local images in docker-compose.yml
# Change image names to use :local tag
# Start home server locally
cd home
go run main.go
# Start agent locally
cd agent
HOME_SERVER_URL=http://localhost:8085 AGENT_NAME=dev-agent go run main.go
GET /api/health
GET /api/agents
GET /api/agents/:agentId
WS /api/ws
This project is licensed under the MIT License - see the LICENSE file for details.
Need help? Open an issue on GitHub or check the troubleshooting section above.
Want to contribute? Pull requests are welcome! Please read the contributing guidelines first.
Content type
Image
Digest
sha256:fc024de02…
Size
13.8 MB
Last updated
about 1 year ago
docker pull hhftechnology/vps-monitor-home