← All tools

SMART disk monitoring template for Zabbix agent 2

Know when a disk is wearing out before it fails. This Zabbix template reads S.M.A.R.T. data from HDDs, SATA SSDs and NVMe drives, including disks behind RAID controllers, and alerts on SSD wear, failure attributes and disk age.

Why another SMART template?

The official “SMART by Zabbix agent 2” template covers the basics, but it doesn't tell you how much life an SSD has left. Every vendor reports wear under a different attribute name, and some count up while others count down. This template adds those vendor attributes, turns them into one “% life remaining” value, and alerts on it.

It works with the stock Zabbix agent 2 (7.0.x, tested on 7.0.32). No external scripts or custom agent builds. It has its own UUIDs, so you can import it next to the official template.

What it monitors

Every disk smartctl can read gets temperature, power-on hours, model, serial number, smartctl exit status and self-test result. NVMe disks also get percentage used, critical warning and media errors. Vendor attributes are added when the disk reports them:

DiskEndurance itemExtra items
Samsung SATA SSDWear_Leveling_CountTotal bytes written, Runtime_Bad_Block, Uncorrectable_Error_Cnt, CRC_Error_Count
Micron / Crucial SATA SSDPercent_Lifetime_RemainTotal bytes written, Current_Pending_Sector, Offline_Uncorrectable, UDMA_CRC_Error_Count, Reported_Uncorrect
WD (Red SA500 and others)Media_Wearout_IndicatorTotal bytes written, UDMA_CRC_Error_Count, Reported_Uncorrect
Kingston SSDSSD_Life_LeftTotal bytes written if reported
NVMe (any brand)Percentage usedCritical warning, media errors
HDD (any brand)–Reallocated_Sector_Ct, Current_Pending_Sector, Offline_Uncorrectable, Seek_Error_Rate and more

Tested on Samsung 860/870 EVO, Micron MTFDDAK960TCB, WD Red SA500 and Samsung 980 / 980 PRO NVMe drives, with SATA disks behind an HP Smart Array (cciss) controller.

Alerts

Setup

  1. Install Zabbix agent 2 (7.0 or newer) and smartmontools 7.1 or newer.
  2. Tell the agent where smartctl is, if it's not in its PATH:
    Plugins.Smart.Path=/usr/sbin/smartctl
  3. Let the zabbix user run smartctl as root. Run visudo and add:
    zabbix ALL=(ALL) NOPASSWD:/usr/sbin/smartctl
  4. Check that the agent sees the disks:
    zabbix_agent2 -t smart.disk.discovery
  5. Import zbx_export_templates7_0.yaml in Zabbix and link the template to the host.

On HP Smart Array hosts, set {$SMART.DISK.NAME.NOT_MATCHES} to scsi$ to skip the controller's logical volume, which has no SMART data.

Some disks need a per-disk macro, for example WD models whose wear counter counts up or that report writes in GiB. The README lists these settings.

Zabbix 6.0

For Zabbix 6.0 LTS the repository also has an older template and patched, precompiled agent 2 builds, since the 6.0 agent doesn't return normalized SMART values on its own.