Historical Status
Displaying historical node data on the dashboard
Historical Node Data
The historical node data feature (Rewind) lets you track and analyze the state of your cluster nodes over time. This is useful for identifying patterns, troubleshooting issues, and capacity planning.
Built-in Snapshots
Since 3.0 the dashboard saves Rewind snapshots itself. Set DATABASE_URL to a PostgreSQL database and the dashboard creates its node_snapshots table on startup and saves a snapshot of all nodes every hour. Rewind turns on by itself; you don't need a flag or a cron job. See Features and the Database for database setup and permissions.
The dashboard checks every minute and saves a snapshot once the latest one is an interval old, so restarting the dashboard doesn't reset the schedule. Snapshots older than the retention period are deleted after each new snapshot.
Configuration Options
| Setting | Default | |
|---|---|---|
SNAPSHOT_INTERVAL_MINUTES | 60 | Minutes between snapshots. 0 turns built-in Rewind snapshots off |
SNAPSHOT_RETENTION_DAYS | 30 | Days to keep snapshots. 0 keeps snapshots forever |
NEXT_PUBLIC_ENABLE_HISTORY_PLUGIN | unset | false turns Rewind off |
Restart the dashboard after changing these settings.
If you run several dashboard instances against one database, only one of them saves snapshots at a time; the others take over if it stops.
Upgrading from the Cron Script
Before 3.0, snapshots came from an hourly cron script that saved .json.gz files into the dashboard's data/ directory. With a database configured you can remove that cron job.
Rewind still reads those files. For each hour it looks for a snapshot in the database first and falls back to the files in data/, so your older history stays available. The old script also deleted files older than 30 days; once you remove it, delete old files from data/ yourself when you no longer need them.
Check the File Times:
Earlier versions of the script named files in the server's local time. 3.0 reads the names as UTC, so if the cron host wasn't on UTC, older history shows up shifted by its UTC offset. See Snapshot File Times to rename them once.
Without a Database
Rewind also works without a database, from files the old script writes. If you can't add a database, keep running it hourly from cron:
#!/bin/bash
SAVE_DIR="/path/to/slurm-node-dashboard/data"
mkdir -p "$SAVE_DIR"
FILENAME=$(date -u +"%Y-%m-%dT%H-%M-%S.000Z.json.gz")
curl -s "http://localhost:3020/api/slurm/nodes" | gzip > "$SAVE_DIR/$FILENAME"
find "$SAVE_DIR" -name "*.json.gz" -type f -mtime +30 -delete
This script:
- Names the file for the current time in UTC (
date -u), which is how Rewind reads it - Fetches current node data from the API endpoint
- Compresses the data and stores it in the dashboard's
data/directory - Automatically removes files older than 30 days to manage disk space
Check the Plugins Tab:
Admin → Plugins shows whether Rewind is on and where its snapshots come
from: the database, or snapshot files in data/.