TSF – Giải pháp IT toàn diện cho doanh nghiệp SMB | HCM

P9 - PRTG Monitor Proxmox Disk | Physical Disk Health & Alerts

PRTG – P9 PRTG Proxmox Disk Monitoring | Physical Disk Health & Alerts

Disk failures are among the most dangerous issues in any virtualization environment. Unlike CPU or RAM overload, storage problems often develop silently before causing serious downtime. A single failing disk can impact multiple virtual machines, corrupt data, or even bring an entire node offline.

In this tutorial, you’ll learn how to Monitor Proxmox Disk health using PRTG Network Monitor. This step-by-step guide explains how to collect SMART disk data, detect missing disks, validate ZFS health, and configure disk monitoring alerts properly.

PRTG enables IT administrators to detect disk issues early through real-time monitoring and alert notifications. In this guide, we demonstrate how to monitor physical disks on Proxmox hosts effectively, whether using EXT storage or ZFS pools.

This tutorial is designed for system administrators and virtualization engineers who want proactive infrastructure protection.

Follow this guide to protect your Proxmox infrastructure from unexpected disk failures.


🛠 Step 1: Create a Disk Check Script

We will create a custom script that PRTG executes using the SSH Script Advanced sensor.

Create a folder (using SSH Advanced Scripts)

 
 
mkdir -p /var/prtg/scriptsxml
 

Create a script file

 
 
nano /var/prtg/scriptsxml/prtg_check_all_storage.sh
 

Contents

💻
prtg_check_all_storage.sh
#!/bin/bash

BASELINE_FILE="/var/prtg/storage_baseline.txt"
STATUS=0
MSG="All disks OK"

################################
# Detect current disks
################################
CURRENT_DISKS=$(lsblk -ndo NAME,TYPE | awk '$2=="disk"{print $1}')
CURRENT_COUNT=$(echo "$CURRENT_DISKS" | wc -w)

################################
# BASELINE DISK CHECK (ALWAYS)
################################
if [ -f "$BASELINE_FILE" ]; then
    MISSING=""

    while IFS="|" read -r WWN DEV MODEL; do
        if [ "$WWN" = "NO_WWN" ]; then
            lsblk -ndo NAME | grep -qw "$DEV" || \
            MISSING="$MISSING $MODEL($DEV)"
        else
            lsblk -P -o WWN | grep -qw "WWN=\"$WWN\"" || \
            MISSING="$MISSING $MODEL($DEV,WWN:$WWN)"
        fi
    done < "$BASELINE_FILE"

    if [ -n "$MISSING" ]; then
        STATUS=2
        MSG="Disk missing:$MISSING"
    fi
else
    STATUS=1
    MSG="Baseline not initialized"
fi

################################
# ZFS HEALTH CHECK (OPTIONAL)
################################
if command -v zpool >/dev/null 2>&1; then
    if zpool list >/dev/null 2>&1; then
        ZFS_BAD=$(zpool list -H -o name,health | awk '$2!="ONLINE"{print $1"("$2")"}')
        if [ -n "$ZFS_BAD" ]; then
            STATUS=2
            MSG="ZFS issue: $ZFS_BAD"
        fi
    fi
fi

################################
# SMART CHECK
################################
BAD_SMART=""
if command -v smartctl >/dev/null 2>&1; then
    for d in $CURRENT_DISKS; do
        smartctl -H /dev/$d &>/dev/null
        [ $? -eq 2 ] && BAD_SMART="$BAD_SMART /dev/$d"
    done
fi

if [ -n "$BAD_SMART" ]; then
    STATUS=2
    MSG="SMART failure:$BAD_SMART"
fi

################################
# PRTG XML OUTPUT
################################
cat <<EOF
<prtg>
  <result>
    <channel>Storage Health</channel>
    <value>$STATUS</value>
    <LimitMaxError>1</LimitMaxError>
    <LimitMode>1</LimitMode>
  </result>

  <result>
    <channel>Disk Count</channel>
    <value>$CURRENT_COUNT</value>
  </result>

  <text>$MSG</text>
</prtg>
EOF

exit 0

grant permission and run

chmod +x /var/prtg/scriptsxml/prtg_check_all_storage.sh
/var/prtg/scriptsxml/prtg_check_all_storage.sh

This script works for both Proxmox EXT and ZFS nodes, regardless of disk quantity.


🔐 Step 2: Add the SSH Root Certificate to the Proxmox Device

Ensure the PRTG server trusts the SSH connection to the Proxmox host.
Configure SSH credentials properly inside PRTG so the sensor can execute the script remotely.


📌 Step 3: Run the Baseline (Only Once)

When the system is in a healthy state, run the baseline.

Run it manually on Proxmox:

 
💻
filename.sh
lsblk -P -o NAME,TYPE,WWN,MODEL | \
awk '/TYPE="disk"/{
  for(i=1;i<=NF;i++){
    if($i ~ /^NAME=/){gsub(/NAME=|"/,"",$i); name=$i}
    if($i ~ /^WWN=/){gsub(/WWN=|"/,"",$i); wwn=$i}
    if($i ~ /^MODEL=/){
      sub(/^MODEL="/,"",$i)
      model=$i
      for(j=i+1;j<=NF;j++){
        if($j ~ /"$/){sub(/"$/,"",$j); model=model" "$j; break}
        model=model" "$j
      }
    }
  }
  if(wwn=="") wwn="NO_WWN"
  print wwn "|" name "|" model
}' > /var/prtg/storage_baseline.txt

No need to add the sensor before or after.
The important thing is to run it when the disk state is fully healthy.


ZFS Notes

With ZFS, ZFS manages disks itself:

• No baseline needed
• No need to worry about disk name changes

The script automatically checks:

 
 
zpool list -o health
 

You only need:

✔ ZFS pool ONLINE → 🟢
✔ DEGRADED / FAULTED → 🔴


📊 Step 4: Add Sensor in PRTG

Add sensor:

SSH Script Advanced

Attach to PRTG:

• Sensor type: SSH Script
• Result handling:
o 0 → OK
o 1 → Down

PRTG will interpret the XML output automatically and trigger alerts based on the Storage Health channel.


🧪 Demo Scenario

Try removing one disk from the system.

The script will detect:

  • Missing disk from baseline

  • ZFS degraded pool

  • SMART failure

PRTG will immediately change sensor status and trigger alerts.


🔄 When to Rerun the Baseline

The baseline must be rerun when:

  • Replacing a disk

  • Adding a new disk

  • Replacing the USB enclosure

This ensures the baseline file reflects the current hardware configuration.


🚀 Why You Must Monitor Proxmox Disk Proactively

When you properly Monitor Proxmox Disk infrastructure, you gain:

  • Early disk failure detection

  • SMART-based health monitoring

  • ZFS pool integrity validation

  • Automatic missing disk detection

  • Centralized alerting through PRTG

Disk failures rarely happen instantly. They usually show early warning signals first. With proactive monitoring in place, you can replace hardware before critical downtime occurs.


📌 Final Thoughts

You have now implemented a powerful and flexible solution to Monitor Proxmox Disk health using PRTG Network Monitor.

By creating a custom disk health script, establishing a baseline, validating ZFS pools, and attaching the SSH Script Advanced sensor, you gain complete visibility into physical storage health.

This proactive monitoring strategy protects your virtualization environment from silent failures and unexpected outages.

In the next tutorial, we will continue expanding advanced Proxmox monitoring capabilities inside the PRTG ecosystem.

 
 

See also related articles

P3 – Powerful Guide 2026 Monitor WAN IP with PRTG

P3 – Powerful Guide 2026 Monitor WAN IP with PRTG PRTG – P3 Monitor Internet & WAN IP Using PRTG Network Monitor Monitoring your Internet connection is critical for any business infrastructure. If your WAN connection goes down, services such as email, VPN, remote access, and cloud applications become unavailable...

Read More

P2 – Secure PRTG Fast: Change Port PRTG & Enable SSL

P2 – Secure PRTG Fast: Change Port PRTG & Enable SSL PRTG – P2 Secure PRTG with SSL | Enable HTTPS & Change Default Port Securing your monitoring system is not optional — it is essential. In this guide, we will walk through how to secure PRTG Network Monitor by...

Read More

P1 – Complete Install PRTG Guide for Windows 10

PRTG – P1 How to Install PRTG on Windows 10 | Initial Setup & Configuration 🚀 Install PRTG on Windows 10 – Initial Setup & Configuration (P1) If you are starting your monitoring journey, learning how to Install PRTG properly is the first critical step. In this tutorial, I will...

Read More