WD NAS App Builder

All apps

Node Exporter 1.12.1-1

The NAS's hardware, system and WD storage metrics for Prometheus and Grafana

monitoring

Download

NASSizeSHA256
My Cloud PR410012 MBDownloadef0aeb86a118c294…
My Cloud PR210012 MBDownload236b634a5351f4ce…
My Cloud DL410012 MBDownload868223e8475dcd19…
My Cloud DL210012 MBDownload08e7999f047908cf…
My Cloud EX410011 MBDownloada04182ab3636c02c…
My Cloud EX210011 MBDownloadc469773eea134e9e…
My Cloud EX2 Ultra11 MBDownload4fbf2e82614a61cc…
My Cloud Mirror (Gen 2)11 MBDownload3d6b70147b51840f…
My Cloud (Gen 2)11 MBDownload069343d6a1e60a0e…
WD Cloud11 MBDownload3c8ab2b42c875c37…

Easier: install it from the Store, which also updates it.

Node Exporter is Prometheus's official exporter for a machine's hardware and system metrics (CPU, memory, load, disk I/O, filesystems, network, temperatures, software RAID…). Prometheus collects them from it, and Grafana shows them.

  • The metrics are at http://<nas-ip>:9100/metrics (the port can be changed on the management page).
  • The app adds WD's own view of the storage, which Linux alone doesn't show, as metrics starting with wd_ (see below).
  • Nothing is written to the disks while it runs: its files and log are kept in RAM (/tmp), and WD's records are read rather than the disks themselves, so sleeping disks stay asleep.
  • Its settings (port, password) are kept next to the app, e.g. /mnt/HD/HD_a2/Nas_Prog/_node_exporter, and survive reinstalls.
  • Node Exporter doesn't update itself: updates come with new versions of the app, and the NAS shows an alert (and sends an email, if set up) when a new release is out, checked weekly.

WD storage metrics

A small script reads WD's records of the disks, RAID arrays and volumes every 30 seconds (the same ones the dashboard's Storage pages use, via WD's xmldbc), and Node Exporter serves them with its own metrics (through its textfile collector):

MetricLabelsValue
wd_healthOverall storage health: 0 healthy, 1 degraded (e.g. a disk too hot, a RAID rebuilding), 2 critical (e.g. a failed disk, a degraded RAID, a volume not mounted)
wd_infomodel, firmwareAlways 1
wd_disk_infodisk, bay, vendor, model, firmwareAlways 1
wd_disk_temperature_celsiusdisk, bayThe temperature WD last read
wd_disk_healthy, wd_disk_failed, wd_disk_over_temperature, wd_disk_sleepingdisk, bay1 or 0
wd_disk_smart_passeddisk, bayWhether the last SMART test WD ran passed (only once one has run)
wd_disk_size_bytesdisk, bay
wd_raid_inforaid, level, systemAlways 1 (system="1" is WD's own small system array, md0)
wd_raid_stateraid, stateAlways 1: the state is the label (e.g. clean, degraded, recovering)
wd_raid_disksraid, stateDisk counts: total, active, working, spare, failed, rebuilding
wd_raid_dirtyraid1 or 0
wd_raid_size_bytesraid
wd_volume_infovolume, label, mountpoint, raid, raid_levelAlways 1
wd_volume_mounted, wd_volume_encrypted, wd_volume_unlockedvolume1 or 0
wd_volume_size_bytes, wd_volume_used_bytesvolume
wd_collector_successWhether WD's records could all be read

Disk serial numbers are left out. For alerts, e.g. wd_health > 0, wd_disk_temperature_celsius > 55 or wd_raid_disks{state="failed"} > 0.

SMART metrics

WD's records only say whether a disk has passed or failed. Every 5 minutes the script also reads each disk's own SMART data with smartctl (smartmontools 7.5, built static by static/node_exporter for the Intel models - the ARM models use the NAS's own smartctl, if it has one), with -n standby: a sleeping disk isn't woken, and its last reading is kept until it wakes.

MetricLabelsValue
wd_smart_healthydisk, bayThe disk's own health assessment: 1 passed, 0 failed
wd_smart_attribute_rawdisk, bay, id, attributeEach attribute's raw value (its first number - e.g. sectors, hours, degrees)
wd_smart_attribute_value, wd_smart_attribute_thresholdthe sameThe normalised value (higher is better), and the threshold at or below which it counts as failing
wd_smart_attribute_failingthe same1 if the attribute is failing now or has failed before
wd_smart_last_read_timestamp_secondsdisk, bayWhen the values were last read
wd_smart_asleepdisk, bay1 if the disk was asleep at the last attempt (so the values are from before)
wd_smart_successWhether SMART values could be read for at least one disk

The attributes that warn of a failing disk are 5 (Reallocated_Sector_Ct), 197 (Current_Pending_Sector) and 198 (Offline_Uncorrectable) - any above 0 deserves attention, and a rising count means trouble - and 199 (UDMA_CRC_Error_Count: cable or connection errors). For alerts, e.g. wd_smart_attribute_raw{id=~"5|197|198"} > 0 or wd_smart_healthy == 0. The Grafana app's WD NAS dashboard shows them per disk, and Node Exporter's page shows each disk's SMART health and problem sectors.

Management page

Node Exporter's page in the NAS dashboard (Apps → Node Exporter) shows whether it's running, its version and metrics address, and the storage as WD sees it (disks with temperatures and SMART health, RAID arrays, volumes and overall health). It changes the port, can require a password (see below), gives a prometheus.yml snippet to copy, and shows Node Exporter's latest warnings. Only NAS admins can use the page (see Management pages).

Password

Like Node Exporter on other machines, the metrics can be read by anyone on the local network by default (they show the NAS's activity, not its files or settings). The management page can require a password: tick the box, enter a password (or leave it empty to generate one) and save. The user name is prometheus, and the password can be shown, copied or changed on the page afterwards. It's saved, readable by root only, in Nas_Prog/_node_exporter/password, and Node Exporter is given only its hash (in web-config.yml). Add the basic_auth lines from the page's snippet to Prometheus.