AnswersFile

Question

How to Monitor Unraid Stats in Home Assistant via SNMP?

Answer

Step 1: Install SNMP on Unraid

Install the SNMP plugin from Unraid Community Apps. Search for "SNMP" in the Apps tab and install it.

Step 2: Add sensors to Home Assistant

Add the following configuration to your Home Assistant configuration.yaml. Replace 192.168.1.3 with your Unraid server's IP address.

What this monitors:

  • CPU usage (user, system, idle)
  • Memory (total, free, cached, usage percentage)
  • Load average (1, 5, 15 minute)
  • Network throughput (download/upload in Mbps)
  • System uptime
# ============================================
# UNRAID SERVER SNMP MONITORING
# netserve at 192.168.1.3
# ============================================

sensor:
  # ============================================
  # SYSTEM INFO
  # ============================================
  - platform: snmp
    host: 192.168.1.3
    community: public
    version: '2c'
    name: "Unraid Uptime Raw"
    baseoid: 1.3.6.1.2.1.1.3.0
    accept_errors: true

  - platform: snmp
    host: 192.168.1.3
    community: public
    version: '2c'
    name: "Unraid Hostname"
    baseoid: 1.3.6.1.2.1.1.5.0
    accept_errors: true

  # ============================================
  # CPU METRICS - OVERALL ONLY
  # ============================================
  - platform: snmp
    host: 192.168.1.3
    community: public
    version: '2c'
    scan_interval: 10
    name: "Unraid CPU Idle"
    baseoid: 1.3.6.1.4.1.2021.11.11.0
    accept_errors: true
    unit_of_measurement: '%'

  - platform: snmp
    host: 192.168.1.3
    community: public
    version: '2c'
    scan_interval: 10
    name: "Unraid CPU User"
    baseoid: 1.3.6.1.4.1.2021.11.9.0
    accept_errors: true
    unit_of_measurement: '%'

  - platform: snmp
    host: 192.168.1.3
    community: public
    version: '2c'
    scan_interval: 10
    name: "Unraid CPU System"
    baseoid: 1.3.6.1.4.1.2021.11.10.0
    accept_errors: true
    unit_of_measurement: '%'

  # ============================================
  # MEMORY METRICS
  # ============================================
  - platform: snmp
    host: 192.168.1.3
    community: public
    version: '2c'
    name: "Unraid Memory Total"
    baseoid: 1.3.6.1.4.1.2021.4.5.0
    accept_errors: true
    unit_of_measurement: 'KB'

  - platform: snmp
    host: 192.168.1.3
    community: public
    version: '2c'
    name: "Unraid Memory Available"
    baseoid: 1.3.6.1.4.1.2021.4.6.0
    accept_errors: true
    unit_of_measurement: 'KB'

  - platform: snmp
    host: 192.168.1.3
    community: public
    version: '2c'
    name: "Unraid Memory Free"
    baseoid: 1.3.6.1.4.1.2021.4.11.0
    accept_errors: true
    unit_of_measurement: 'KB'

  - platform: snmp
    host: 192.168.1.3
    community: public
    version: '2c'
    name: "Unraid Memory Cached"
    baseoid: 1.3.6.1.4.1.2021.4.15.0
    accept_errors: true
    unit_of_measurement: 'KB'

  - platform: snmp
    host: 192.168.1.3
    community: public
    version: '2c'
    name: "Unraid Memory System Available"
    baseoid: 1.3.6.1.4.1.2021.4.100.0
    accept_errors: true
    unit_of_measurement: 'KB'

  # ============================================
  # LOAD AVERAGE
  # ============================================
  - platform: snmp
    host: 192.168.1.3
    community: public
    version: '2c'
    name: "Unraid Load 1min"
    baseoid: 1.3.6.1.4.1.2021.10.1.3.1
    accept_errors: true

  - platform: snmp
    host: 192.168.1.3
    community: public
    version: '2c'
    name: "Unraid Load 5min"
    baseoid: 1.3.6.1.4.1.2021.10.1.3.2
    accept_errors: true

  - platform: snmp
    host: 192.168.1.3
    community: public
    version: '2c'
    name: "Unraid Load 15min"
    baseoid: 1.3.6.1.4.1.2021.10.1.3.3
    accept_errors: true

  # ============================================
  # NETWORK - eth0 (main interface, index 3)
  # ============================================
  - platform: snmp
    host: 192.168.1.3
    community: public
    version: '2c'
    scan_interval: 30
    name: "Unraid eth0 RX Bytes Raw"
    baseoid: 1.3.6.1.2.1.31.1.1.1.6.3
    accept_errors: true
    unit_of_measurement: 'B'

  - platform: snmp
    host: 192.168.1.3
    community: public
    version: '2c'
    scan_interval: 30
    name: "Unraid eth0 TX Bytes Raw"
    baseoid: 1.3.6.1.2.1.31.1.1.1.10.3
    accept_errors: true
    unit_of_measurement: 'B'

  # ============================================
  # CALCULATE NETWORK RATES
  # ============================================
  - platform: derivative
    source: sensor.unraid_eth0_rx_bytes_raw
    name: "Unraid eth0 RX Rate"
    unit_time: s
    time_window: "00:00:30"
    unit: B/s

  - platform: derivative
    source: sensor.unraid_eth0_tx_bytes_raw
    name: "Unraid eth0 TX Rate"
    unit_time: s
    time_window: "00:00:30"
    unit: B/s

# ============================================
# TEMPLATES
# ============================================
template:
  - sensor:
      # CPU
      - name: "Unraid CPU Usage"
        unique_id: unraid_cpu_usage
        unit_of_measurement: "%"
        icon: mdi:cpu-64-bit
        state: >
          {% set idle = states('sensor.unraid_cpu_idle') | float(0) %}
          {{ (100 - idle) | round(1) }}
        availability: >
          {{ states('sensor.unraid_cpu_idle') not in ['unknown', 'unavailable', 'none'] }}

      # MEMORY
      - name: "Unraid Memory Usage"
        unique_id: unraid_memory_usage
        unit_of_measurement: "%"
        icon: mdi:memory
        state: >
          {% set total = states('sensor.unraid_memory_total') | float(0) %}
          {% set free = states('sensor.unraid_memory_free') | float(0) %}
          {% set cached = states('sensor.unraid_memory_cached') | float(0) %}
          {% if total > 0 %}
            {{ (((total - free - cached) / total) * 100) | round(1) }}
          {% else %}
            0
          {% endif %}

      - name: "Unraid Memory Used GB"
        unique_id: unraid_memory_used_gb
        unit_of_measurement: "GB"
        icon: mdi:memory
        state: >
          {% set total = states('sensor.unraid_memory_total') | float(0) %}
          {% set free = states('sensor.unraid_memory_free') | float(0) %}
          {% set cached = states('sensor.unraid_memory_cached') | float(0) %}
          {{ ((total - free - cached) / 1048576) | round(2) }}

      - name: "Unraid Memory Total GB"
        unique_id: unraid_memory_total_gb
        unit_of_measurement: "GB"
        icon: mdi:memory
        state: >
          {% set total = states('sensor.unraid_memory_total') | float(0) %}
          {{ (total / 1048576) | round(2) }}

      # NETWORK
      - name: "Unraid Network Download"
        unique_id: unraid_network_download
        unit_of_measurement: "Mbps"
        icon: mdi:download-network
        state: >
          {% set rate = states('sensor.unraid_eth0_rx_rate') | float(0) %}
          {% set mbps = ((rate * 8) / 1000000) | round(2) %}
          {{ [mbps, 0] | max }}
        availability: >
          {{ states('sensor.unraid_eth0_rx_rate') not in ['unknown', 'unavailable', 'none'] }}

      - name: "Unraid Network Upload"
        unique_id: unraid_network_upload
        unit_of_measurement: "Mbps"
        icon: mdi:upload-network
        state: >
          {% set rate = states('sensor.unraid_eth0_tx_rate') | float(0) %}
          {% set mbps = ((rate * 8) / 1000000) | round(2) %}
          {{ [mbps, 0] | max }}
        availability: >
          {{ states('sensor.unraid_eth0_tx_rate') not in ['unknown', 'unavailable', 'none'] }}

      # UPTIME
      - name: "Unraid Uptime"
        unique_id: unraid_uptime
        icon: mdi:clock-outline
        state: >
          {% set timeticks = states('sensor.unraid_uptime_raw') | float(0) %}
          {% set seconds = (timeticks / 100) | int %}
          {% set days = (seconds / 86400) | int %}
          {% set hours = ((seconds % 86400) / 3600) | int %}
          {% set minutes = ((seconds % 3600) / 60) | int %}
          {% if days > 0 %}
            {{ days }}d {{ hours }}h {{ minutes }}m
          {% elif hours > 0 %}
            {{ hours }}h {{ minutes }}m
          {% else %}
            {{ minutes }}m
          {% endif %}

Important notes

  • Replace 192.168.1.3 with your Unraid server's IP address throughout the configuration
  • The network interface index (.3 in the OIDs) may differ on your system. Use snmpwalk to find the correct index for your eth0 interface
  • The SNMP community string defaults to public. Change it in both Unraid and Home Assistant if you've configured a different one
  • Restart Home Assistant after adding the configuration