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:
| Disk | Endurance item | Extra items |
|---|---|---|
| Samsung SATA SSD | Wear_Leveling_Count | Total bytes written, Runtime_Bad_Block, Uncorrectable_Error_Cnt, CRC_Error_Count |
| Micron / Crucial SATA SSD | Percent_Lifetime_Remain | Total bytes written, Current_Pending_Sector, Offline_Uncorrectable, UDMA_CRC_Error_Count, Reported_Uncorrect |
| WD (Red SA500 and others) | Media_Wearout_Indicator | Total bytes written, UDMA_CRC_Error_Count, Reported_Uncorrect |
| Kingston SSD | SSD_Life_Left | Total bytes written if reported |
| NVMe (any brand) | Percentage used | Critical 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
- SSD wear: warning, average and critical below 30 / 20 / 10 % life remaining (configurable with macros).
- Failure attributes: pending and uncorrectable sectors, runtime bad blocks, and CRC errors, which usually point to a bad cable or backplane. Alerts when reallocated sectors or reported uncorrectable errors increase.
- Disk age from power-on hours: 8 / 10 / 12 years for HDDs, 6 / 7 / 8 years for SSDs and NVMe.
- Suspicious wear counter: more than 500 TB written while the disk still claims 99–100 % life left.
Setup
- Install Zabbix agent 2 (7.0 or newer) and smartmontools 7.1 or newer.
- Tell the agent where
smartctlis, if it's not in its PATH:Plugins.Smart.Path=/usr/sbin/smartctl - Let the zabbix user run smartctl as root. Run
visudoand add:zabbix ALL=(ALL) NOPASSWD:/usr/sbin/smartctl - Check that the agent sees the disks:
zabbix_agent2 -t smart.disk.discovery - Import
zbx_export_templates7_0.yamlin 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.