Monitoring disk health on VMware ESXi with smartctl

Monitoring disk health on VMware ESXi with smartctl

Table of Contents

Standalone ESXi hosts and small vSphere clusters often run on local SATA or SAS disks — in a homelab, a branch office, or a backup host. When one of those disks starts to fail, you want to know about it from your monitoring, not from a datastore that suddenly goes read-only.

On a normal Linux server the answer is smartctl from smartmontools. ESXi doesn’t ship it, and its built-in esxcli storage core device smart get returns only a handful of values (and often N/A for disks behind a controller). We packaged smartctl as a VIB so it can be installed on ESXi like any other host package.

Project: github.com/bsv9/smartctl-esxi-vib — smartctl 7.5 for ESXi 7, 8 and 9.

Warning

The VIB is community-supported and unsigned by VMware, so it does not work on hosts with Secure Boot enabled. Use it where you control the host configuration and understand the support implications.

Installation

  1. Download the latest VIB, for example smartctl-7.5-5714.x86_64.vib.

  2. Copy it to /tmp/ on the ESXi host:

    scp smartctl-7.5-5714.x86_64.vib root@esxi-host:/tmp/
    
  3. SSH to the host and allow community-supported packages:

    esxcli software acceptance set --level=CommunitySupported
    
  4. Install the package. Neither maintenance mode nor a reboot is required:

    esxcli software vib install -v /tmp/smartctl-7.5-5714.x86_64.vib
    

The binary is installed to /opt/smartmontools/smartctl. You can check the package with esxcli software vib get -n smartctl and remove it at any time, again without a reboot:

esxcli software vib remove -n smartctl

Reading SMART data

Find your disks under /dev/disks/ (or with esxcli storage core device list) and query one of them. For SATA disks, -d sat,auto lets smartctl pick the right pass-through:

[root@host:~] /opt/smartmontools/smartctl -s on -d sat,auto -A /dev/disks/t10.ATA_____ST2000VX0082D2E3164__________________________________Z52C5LJ1
smartctl 7.5 2025-04-30 r5714 [x86_64-linux-8.0.3] (local build)
Copyright (C) 2002-25, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF ENABLE/DISABLE COMMANDS SECTION ===
SMART Enabled.

=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000f   114   099   006    Pre-fail  Always       -       69586192
  3 Spin_Up_Time            0x0003   096   096   000    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   100   100   020    Old_age   Always       -       118
  5 Reallocated_Sector_Ct   0x0033   100   100   010    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000f   072   060   030    Pre-fail  Always       -       18572538
  9 Power_On_Hours          0x0032   091   091   000    Old_age   Always       -       8349h+00m+00.000s
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       109
184 End-to-End_Error        0x0032   100   100   099    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   100   100   000    Old_age   Always       -       0
188 Command_Timeout         0x0032   100   100   000    Old_age   Always       -       0
189 High_Fly_Writes         0x003a   096   096   000    Old_age   Always       -       4
190 Airflow_Temperature_Cel 0x0022   071   055   045    Old_age   Always       -       29 (Min/Max 19/29)
191 G-Sense_Error_Rate      0x0032   100   100   000    Old_age   Always       -       0
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       102
193 Load_Cycle_Count        0x0032   100   100   000    Old_age   Always       -       130
194 Temperature_Celsius     0x0022   029   045   000    Old_age   Always       -       29 (0 19 0 0 0)
197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0010   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0

[root@host:~] uname -a
VMkernel host 8.0.3 #1 SMP Release build-24022510 Jun 11 2024 05:59:34 x86_64 x86_64 x86_64 ESXi

Useful variations:

  • smartctl -H <disk> — the overall health verdict (PASSED / FAILED).
  • smartctl -a <disk> — everything: identity, attributes, error log and self-test log.
  • smartctl -t short <disk> — start a short self-test; read the result later with -l selftest.

Which attributes actually matter

Most of the table is informational. Raw values of attributes such as Raw_Read_Error_Rate or Seek_Error_Rate are vendor-encoded and look alarming on Seagate drives even when the disk is perfectly healthy. The ones worth alerting on are:

ID Attribute Why it matters
5 Reallocated_Sector_Ct Sectors already remapped to spares. Any growth is a warning sign.
197 Current_Pending_Sector Unreadable sectors waiting to be remapped. Non-zero means data is at risk.
198 Offline_Uncorrectable Sectors that could not be read during offline scans.
187 Reported_Uncorrect Errors the drive could not correct with ECC.
188 Command_Timeout Often points to cabling, power or controller trouble.
199 UDMA_CRC_Error_Count Transfer errors between disk and controller — usually a bad cable or backplane.
194 Temperature_Celsius Sustained high temperatures shorten disk life.

A practical rule: alert on any increase of 5, 197, 198 and 187, and on temperature above the drive’s rated limit (typically 50–60 °C for HDDs).

Feeding the data into Zabbix

Tip

Don’t want to build the items by hand? Our ready-made template does all of this, with disk discovery and triggers — see ESXi disk health in Zabbix. Below is how it works under the hood.

ESXi cannot run a Zabbix agent, and its SNMP agent does not expose SMART attributes. The simplest reliable approach is to let the Zabbix server or proxy run smartctl over SSH:

  1. Enable SSH on the host and add a dedicated key for the Zabbix user (keys live in /etc/ssh/keys-root/authorized_keys on ESXi).

  2. Create an item of type SSH agent with public-key authentication, for example key ssh.run[smart.disk1.realloc] and the command:

    /opt/smartmontools/smartctl -A -d sat,auto /dev/disks/<disk-id> | awk '$1==5 {print $10}'
    
  3. Repeat for the attributes from the table above (or return the full -A output into one text item and extract values with dependent items and regular-expression preprocessing — one SSH call per disk instead of one per attribute).

  4. Add triggers such as change(/esxi-host/ssh.run[smart.disk1.realloc])>0 and a threshold on temperature.

Poll every 15–30 minutes: SMART values change slowly, and there is no point in waking the disks more often.

The same data can of course go to Prometheus or any other system that can run a remote command; the important part is that smartctl is now available on the host.

Summary

  • Install smartctl as a VIB: no reboot, no maintenance mode, works on ESXi 7, 8 and 9 (without Secure Boot).
  • Use /opt/smartmontools/smartctl exactly as on Linux.
  • Alert on reallocated, pending and uncorrectable sectors and on temperature — not on raw read/seek error rates.

Need help setting up monitoring for your vSphere or Proxmox infrastructure? Get in touch.

comments powered by Disqus

Related Posts

How to monitor your home internet connection — and prove it to your ISP

How to monitor your home internet connection — and prove it to your ISP

The video call freezes, the game lags, the trading terminal reconnects. A speed test five minutes later shows 500 Mbit/s and everything looks fine. You call your provider, they “see no issues on the line”, and suggest restarting the router.

Read More
Monitoring Wazuh agents in Zabbix via the REST API

Monitoring Wazuh agents in Zabbix via the REST API

Wazuh is a popular open-source SIEM/XDR: agents on servers and workstations collect logs, file-integrity events and vulnerability data, and send them to the Wazuh manager. It works well — as long as the agents are actually connected.

Read More
Are your network config backups actually working? Oxidized + Zabbix

Are your network config backups actually working? Oxidized + Zabbix

Oxidized is the de facto open-source tool for backing up network device configurations. It logs into switches, routers and firewalls — Cisco, Juniper, MikroTik, Fortinet, HPE/Aruba and dozens of others — downloads the running config and stores every version in Git. When a device dies or someone breaks the config, you have the last known good version and a diff of what changed.

Read More