systemd-report-diskhealth@.service, systemd-report-diskhealth.socket, systemd-report-diskhealth — Report disk identity and NVMe/ATA SMART health information as system report metrics
systemd-report-diskhealth@.service
systemd-report-diskhealth.socket
/usr/lib/systemd/systemd-report-diskhealth
systemd-report-diskhealth@.service is a metrics source for
systemd-report(1). It
reports basic identity information about the disks of the system, as well as the key health parameters
of NVMe and ATA disks, by implementing the io.systemd.Metrics Varlink interface on a
socket linked into the /run/systemd/report/ directory.
All whole-disk block devices backed by hardware are reported, i.e. partitions, loopback devices,
device mapper devices and other virtual block devices, as well as drives without a medium, are skipped.
Only block devices that have been fully probed by
systemd-udevd.service(8)
are considered. The metric object is the device node of the block device, for example
/dev/nvme0n1 or /dev/sda. No metric fields are set.
The following metrics are reported for all disks. The model, vendor and serial strings are taken from the udev database, preferring information from the hardware database over the information the device reports about itself. If the block device carries no model or vendor information, the one of the PCI device of an NVMe disk or of the USB device of a USB disk is used instead. Metrics for which no information is available are omitted.
io.systemd.DiskHealth.DiskLogicalSectorSizeBytes"¶The logical sector size of the disk in bytes, i.e. the smallest unit the disk can be addressed in.
io.systemd.DiskHealth.DiskModel"¶The model name of the disk.
io.systemd.DiskHealth.DiskPhysicalSectorSizeBytes"¶The physical sector size of the disk in bytes, i.e. the smallest unit the disk can write without a read-modify-write cycle, as reported by the kernel.
io.systemd.DiskHealth.DiskSerial"¶The serial number of the disk.
io.systemd.DiskHealth.DiskSizeBytes"¶The size of the disk in bytes.
io.systemd.DiskHealth.DiskVendor"¶The vendor name of the disk. Note that ATA disks do not report a vendor, hence this metric is typically not available for them.
The following metrics are reported for NVMe disks and for ATA disks. For NVMe disks they are taken from the SMART / Health Information log page, for ATA disks from the General Statistics page of the Device Statistics log. ATA disks which do not implement the Device Statistics log do not report these metrics.
The following metrics are reported for NVMe disks only, and are taken from the SMART / Health Information log page of the controller. If multiple namespaces are attached to the same controller, the same values are reported for all of them.
io.systemd.DiskHealth.NVMeAvailableSparePercent"¶The remaining spare capacity in percent.
io.systemd.DiskHealth.NVMeCriticalWarning"¶The critical warning bitmask. This is zero if all is well. Otherwise, bit 0 indicates that the spare capacity dropped below the threshold, bit 1 that a temperature threshold was exceeded, bit 2 that the reliability is degraded due to media errors, bit 3 that the media has been placed in read-only mode, bit 4 that a volatile memory backup device failed, and bit 5 that the persistent memory region has become read-only.
io.systemd.DiskHealth.NVMeMediaErrors"¶The number of unrecovered data integrity errors over the lifetime of the disk.
io.systemd.DiskHealth.NVMePercentageUsed"¶The vendor specific estimate of the used up life time of the disk in percent. Note that this value may exceed 100.
The following metrics are reported for ATA disks with SMART enabled only. Disks attached via USB
are not queried. In order not to spin up disks merely for collecting metrics, disks in standby mode are
not queried either. The metrics derived from SMART attributes 5, 197 and 198 are only reported for
rotating disks (as indicated by the queue/rotational sysfs attribute), since various
SSD vendors have reused these attributes for flash specific concepts with incompatible
semantics.
io.systemd.DiskHealth.ATAOfflineUncorrectable"¶The number of uncorrectable sectors found during offline scans (SMART attribute 198).
io.systemd.DiskHealth.ATAPendingSectors"¶The number of unstable sectors waiting to be remapped (SMART attribute 197).
io.systemd.DiskHealth.ATAReallocatedSectors"¶The number of sectors remapped to the spare area (SMART attribute 5).
io.systemd.DiskHealth.ATASmartStatusFailing"¶1 if the overall SMART status of the disk reports that a threshold has been exceeded, i.e. that failure of the disk is predicted, 0 otherwise.
The disk temperature is not reported by this service, see systemd-report-hwmon@.service(8) for that.