Home Software Grafana + Prometheus for NAS Monitoring: A Practical Setup Guide

Grafana + Prometheus for NAS Monitoring: A Practical Setup Guide

Grafana + Prometheus for NAS Monitoring: A Practical Setup Guide

What You Need to Know About Grafana and Prometheus for NAS Monitoring

If you want detailed historical graphs of your NAS CPU, RAM, disk, and network performance—not just a live dashboard that resets on reboot—you need Grafana and Prometheus. Prometheus collects and stores time-series metrics, while Grafana turns that data into visual dashboards. This guide walks you through setting up the full stack on your NAS using Docker Compose, importing a ready-made dashboard, configuring retention to avoid filling your drives, and adding basic alerts. You’ll go from zero to a working monitoring system in under 30 minutes. This guide breaks down grafana prometheus nas monitoring in practical terms.

What Each Piece of the Monitoring Stack Does

Understanding the three components is essential before you start typing commands.

3Components in Stack
15GBTypical Monthly Storage
1WExtra Idle Power Draw

Prometheus: The Metrics Collector and Database

Prometheus scrapes metrics from targets at a configurable interval (default 15 seconds) and stores them in a time-series database. It does not create graphs—it just holds the numbers. You configure it by editing a prometheus.yml file that lists which endpoints to scrape and how often.

For NAS monitoring, Prometheus typically consumes 5–15 GB of storage per month depending on how many metrics you collect and your scrape interval. Most homelabs set retention to 30–90 days to keep disk usage manageable.

Grafana: The Visualization Layer

Grafana connects to Prometheus (or dozens of other data sources) and renders dashboards. You can build panels from scratch or import community dashboards from grafana.com/dashboards. The key advantage over your NAS’s built-in web interface is historical data: you can graph “CPU usage over the last 7 days” or “disk IOPS during the backup window” without relying on real-time polling.

Grafana also handles alerting. You define threshold rules—for example, “disk usage above 90% for 5 minutes”—and it sends notifications via email, Slack, or webhook.

Prometheus Node Exporter: The NAS-Level Metrics Provider

Node Exporter is a small daemon that runs on your NAS and exposes hardware and OS metrics at /metrics. It reports CPU load, memory usage, disk space, disk I/O, network bandwidth, and dozens of other kernel-level stats. Prometheus scrapes Node Exporter’s endpoint, and Grafana visualizes the results.

Node Exporter is lightweight—typically using under 50 MB of RAM and negligible CPU—so it’s safe to run on even a low-power Intel N100 NAS.

💾 Expert Note:

If your NAS runs TrueNAS SCALE, you can install Node Exporter as a custom app through the TrueNAS app catalog rather than using Docker. This keeps everything managed through the TrueNAS UI. For Unraid, install it via the Community Applications plugin as a Docker container. Both approaches work identically.

Setting Up the Monitoring Stack with Docker Compose

Running all three components together in Docker Compose is the fastest way to get started. This assumes your NAS supports Docker (TrueNAS SCALE, Unraid, or any Linux-based NAS with Docker installed).

Creating the Docker Compose File

Create a directory called monitoring on your NAS and inside it create a file named docker-compose.yml with the following content:

1
Define the services

Create a docker-compose.yml file with three services: prometheus, grafana, and node-exporter. Each service runs in its own container but shares a Docker network for communication.

2
Configure Prometheus

Map a local prometheus.yml config file into the container. This file tells Prometheus which targets to scrape and how often. For a NAS, you’ll target Node Exporter on port 9100.

3
Set up Grafana

Grafana needs a persistent volume for dashboards and settings. Map a local directory to /var/lib/grafana. The default login is admin/admin.

4
Add Node Exporter

Node Exporter runs on the host network to access hardware metrics. Use network_mode: "host" and map port 9100.

Here’s a minimal working docker-compose.yml for NAS monitoring:

📄
Sample docker-compose.ymlCopy this into your monitoring directory and adjust paths as needed for your NAS.
version: '3.8'
services:
  prometheus:
    image: prom/prometheus:latest
    container_name: prometheus
    volumes:
      - ./prometheus.yml:/etc/prometheus/prometheus.yml
      - ./prometheus_data:/prometheus
    ports:
      - "9090:9090"
    restart: unless-stopped

  grafana:
    image: grafana/grafana:latest
    container_name: grafana
    volumes:
      - ./grafana_data:/var/lib/grafana
    ports:
      - "3000:3000"
    restart: unless-stopped

  node-exporter:
    image: prom/node-exporter:latest
    container_name: node-exporter
    network_mode: "host"
    restart: unless-stopped

Creating the Prometheus Configuration File

In the same directory, create prometheus.yml:

global:
  scrape_interval: 15s
  evaluation_interval: 15s

scrape_configs:
  - job_name: 'node'
    static_configs:
      - targets: ['localhost:9100']

If your Node Exporter runs on a different host (like a separate TrueNAS server), replace localhost with its IP address. For a detailed comparison of NAS operating systems that support Docker, read our TrueNAS vs Unraid guide.

Starting the Stack

Run docker compose up -d from the monitoring directory. After a few seconds, verify all containers are running with docker compose ps. Access Grafana at http://[your-nas-ip]:3000 and log in with admin/admin.

Importing a Ready-Made NAS Dashboard

Building panels from scratch takes hours. Instead, import a community dashboard designed for NAS monitoring. Grafana Labs hosts thousands of dashboards at grafana.com/dashboards. Search for “Node Exporter Full” or “TrueNAS” to find pre-built options.

How to Import a Dashboard

In Grafana, click the “+” icon on the left sidebar, select “Import,” and paste the dashboard ID (usually a number like 1860 for the popular “Node Exporter Full” dashboard). Grafana will ask you to select a Prometheus data source—choose the one you configured earlier. The dashboard automatically populates with CPU, memory, disk, and network graphs.

If you run TrueNAS SCALE, there are dedicated TrueNAS Grafana dashboards that include ZFS pool metrics. These require a small Python exporter that reads zpool iostat output. For a step-by-step guide on adding media server functionality alongside monitoring, see How to Install Jellyfin on TrueNAS SCALE.

Tip:

After importing a dashboard, check the data source dropdown in the top-left corner of each panel. Some community dashboards assume a default data source name like “Prometheus” that may differ from yours. Edit the panel and correct the data source if graphs show “No data.”

Setting Retention Period to Avoid Unbounded Disk Growth

Prometheus stores all scraped metrics indefinitely by default, which will eventually fill your NAS drive. Setting a retention limit is mandatory for a homelab monitoring stack.

Configuring Retention in Prometheus

Add these flags to the Prometheus container command in your docker-compose.yml:

command:
  - '--storage.tsdb.retention.time=30d'
  - '--storage.tsdb.retention.size=10GB'

This tells Prometheus to keep data for 30 days and cap total storage at 10 GB. Whichever limit is hit first triggers data deletion. For most homelabs, 30 days is sufficient to spot trends and troubleshoot issues. Adjust based on your available disk space—a 4-bay NAS with 12 TB drives can afford 90 days of retention, while a 2-bay NAS with 2 TB drives should stick to 14–30 days.

💾
Retention Rule of ThumbSet retention.time to 30 days and retention.size to 10% of your NAS’s available storage. This prevents Prometheus from silently consuming all free space.

Setting Up Basic Alerting for Threshold-Based Notifications

Grafana can alert you when a metric crosses a threshold. The most critical alert for any NAS is disk space—running out of storage can cause data corruption or service failures.

Creating a Disk Space Alert

In Grafana, navigate to Alerting → Alert rules → New alert rule. Set the query to node_filesystem_avail_bytes{mountpoint="/"} and choose “Reduce” to get the minimum value. Set a threshold condition: “When the value is below 10 GB” (or 10% of total capacity).

Configure a notification channel under Alerting → Contact points. Grafana supports email, Slack, PagerDuty, and webhooks. For a homelab, email to your personal address or a Slack webhook to a private channel works well.

Warning:

Alerts only fire when the condition is met during a Grafana evaluation cycle (default every 10 seconds). They do not replace a proper backup strategy. RAID protects against drive failure, not accidental deletion or ransomware. Always maintain separate backups using tools like ZFS snapshots—read our ZFS Snapshots guide for details.

Other Useful Alerts for NAS Monitoring

  • CPU temperature above 75°C (prevents thermal throttling)
  • Memory usage above 90% for 5 minutes (indicates memory leak)
  • Disk read/write latency above 200ms (possible failing drive)
  • Network interface down (cable or switch issue)

If you’re running multiple Docker containers on your NAS, consider dedicating a separate machine for heavy workloads. Our Best Docker Server Build guide covers hardware options that offload container hosting from your NAS.

Bottom Line: Which Monitoring Stack Should You Choose?

For any NAS running Docker, Grafana and Prometheus with Node Exporter is the gold standard for historical monitoring. It gives you detailed graphs, customizable alerting, and community dashboards that work out of the box. The setup takes under 30 minutes and adds negligible resource overhead.

If you run Unraid, the built-in dashboard is adequate for casual users, but Grafana provides far more depth for troubleshooting and capacity planning. For TrueNAS SCALE, the integration is seamless thanks to native Docker support. Read our Unraid Review for a deeper look at that platform’s monitoring capabilities.

Start with a 30-day retention period and 10 GB storage cap. Import a community dashboard, set up disk space alerts, and you’ll have a production-quality monitoring system that pays for itself the first time it catches a disk filling up before you do.

Frequently Asked Questions

Do I need Grafana and Prometheus together or just one?

You need both for a complete monitoring stack. Prometheus collects and stores metrics but has no built-in visualization—it only provides a basic expression browser for querying data. Grafana handles all graphing, dashboarding, and alerting but cannot collect metrics on its own. Together they form a powerful duo. If you only want live stats without history, your NAS’s built-in web interface (TrueNAS dashboard, Unraid dashboard) may suffice, but you lose the ability to analyze trends over days or weeks.

How much storage does Prometheus use over time?

With default settings (15-second scrape interval, Node Exporter collecting ~800 metrics), Prometheus uses roughly 5–15 GB per month. The exact amount depends on how many targets you scrape and whether you collect additional metrics like ZFS pool stats. Setting a retention cap of 10–20 GB and a time limit of 30–90 days prevents Prometheus from consuming more than you expect. For a 2-bay NAS with limited storage, stick to 30 days and 10 GB maximum.

Are there ready-made dashboards for TrueNAS/Unraid?

Yes. The Grafana dashboard library at grafana.com/dashboards includes dozens of Node Exporter dashboards that work with any Linux-based NAS. Popular IDs include 1860 (Node Exporter Full) and 11074 (Node Exporter Server Metrics). For TrueNAS specifically, search for “TrueNAS” or “ZFS” dashboards—some include ZFS pool metrics like ARC hit rate and pool fragmentation. For Unraid, community dashboards are available that show array status, cache usage, and Docker container stats.

Can Grafana alert me before my NAS runs out of disk space?

Yes. Grafana’s alerting engine can monitor any metric from Prometheus and fire notifications when thresholds are crossed. To alert on disk space, create a rule that checks node_filesystem_avail_bytes for your root mountpoint. Set a threshold like “below 10 GB” or “below 10% of total capacity.” Grafana will evaluate this every 10–30 seconds and send alerts via email, Slack, or webhook. This gives you hours or days of warning before the disk fills completely, depending on how fast your NAS writes data.

📋 Sources & Last Verified:

Last verified: July 10, 2026. Specifications cross-checked against Prometheus documentation, Grafana Labs dashboard library, and TrueNAS SCALE app catalog.

🛡 Shop Recommended Hardware

Prices and stock verified regularly by our affiliate partners. As an affiliate, HomeLabCost may earn a commission on qualifying purchases at no extra cost to you.

Browse Hardware Picks →

homelabcost

HomeLabCost editor covering NAS builds, hardware selection, and homelab server setup guides.

Leave a Reply

Your email address will not be published. Required fields are marked *