104 lines
2.8 KiB
Markdown
104 lines
2.8 KiB
Markdown
# Proxmox Monitor
|
|
|
|
A real-time dashboard for monitoring Proxmox VE nodes, VMs, and LXC containers.
|
|
|
|
## Features
|
|
|
|
- **Node overview** — CPU, memory, uptime, and load for each Proxmox node
|
|
- **VM & LXC tracking** — status, resource usage across all nodes
|
|
- **Summary cards** — total nodes, running/stopped VMs, aggregate memory
|
|
- **Auto-refresh** — polling every 30s (configurable)
|
|
- **Tabbed navigation** — switch between Nodes, VMs, and LXCs
|
|
|
|
## Tech Stack
|
|
|
|
- **Framework** — Next.js 15 (App Router)
|
|
- **UI** — React 19, Tailwind CSS 4
|
|
- **Data fetching** — SWR (auto-refresh), Axios
|
|
- **Proxmox** — API2 Token-based auth
|
|
|
|
## Getting Started
|
|
|
|
### 1. Configure environment variables
|
|
|
|
Copy the example file and fill in your Proxmox credentials:
|
|
|
|
```bash
|
|
cp .env.example .env.local
|
|
```
|
|
|
|
`.env.local` contents:
|
|
|
|
```
|
|
PROXMOX_API_URL=https://your-proxmox-host:8006/api2/json
|
|
PROXMOX_TOKEN_ID=root@pam!token-name
|
|
PROXMOX_TOKEN_SECRET=your-secret-uuid
|
|
API_POLL_INTERVAL=30000
|
|
NODE_TLS_REJECT_UNAUTHORIZED=0
|
|
```
|
|
|
|
> **Creating an API token** in Proxmox: Datacenter > Permissions > API Tokens
|
|
|
|
### 2. Install dependencies
|
|
|
|
```bash
|
|
npm install
|
|
```
|
|
|
|
### 3. Run the development server
|
|
|
|
```bash
|
|
npm run dev
|
|
```
|
|
|
|
Open [http://localhost:3000](http://localhost:3000) in your browser.
|
|
|
|
### 4. Build for production
|
|
|
|
```bash
|
|
npm run build
|
|
npm start
|
|
```
|
|
|
|
## Project Structure
|
|
|
|
```
|
|
src/
|
|
├── app/
|
|
│ ├── api/
|
|
│ │ ├── nodes/route.js # Proxmox node stats
|
|
│ │ ├── vms/route.js # QEMU VMs across all nodes
|
|
│ │ ├── lxc/route.js # LXC containers across all nodes
|
|
│ │ └── status/route.js # Aggregated summary
|
|
│ ├── layout.js
|
|
│ └── page.js
|
|
├── components/
|
|
│ ├── Dashboard.js # Main dashboard with tabs & summary
|
|
│ ├── NodeList.js # Node cards
|
|
│ ├── NodeCard.js # Single node display
|
|
│ ├── VMList.js # VM list view
|
|
│ ├── LXCList.js # LXC list view
|
|
│ └── StatusBadge.js # Online/good/warn/error/dead
|
|
└── lib/
|
|
└── proxmox.js # Proxmox API client & data mappers
|
|
```
|
|
|
|
## Environment Variables
|
|
|
|
| Variable | Required | Description |
|
|
|---|---|---|
|
|
| `PROXMOX_API_URL` | Yes | Base URL of the Proxmox API |
|
|
| `PROXMOX_TOKEN_ID` | Yes | API token ID (e.g. `root@pam!monitorapp`) |
|
|
| `PROXMOX_TOKEN_SECRET` | Yes | API token secret |
|
|
| `API_POLL_INTERVAL` | No | Refresh interval in ms (default: `30000`) |
|
|
| `NODE_TLS_REJECT_UNAUTHORIZED` | No | Set to `0` for self-signed certs |
|
|
|
|
## API Routes
|
|
|
|
| Route | Method | Description |
|
|
|---|---|---|
|
|
| `/api/nodes` | GET | All Proxmox nodes |
|
|
| `/api/vms` | GET | All QEMU VMs |
|
|
| `/api/lxc` | GET | All LXC containers |
|
|
| `/api/status` | GET | Aggregated summary stats |
|