Monitor storage devices health via SNMP?

My setup contains 2 TrueNAS servers, a main server on 24.10 (because VMs) and an offsite backup on 25.04. I also have a separate LibreNMS instance setup on another host. I have the SNMP on the 2 systems enabled and added to LibreNMS.

I would like LibreNMS to alert me when a pool becomes degraded or when a disk fails a smart test, what metrics should I look for and what kind of alert rules should I add?

Pool health is exposed using zpoolHealth.<index>:

Example:

TRUENAS-MIB::zpoolIndex.1 = INTEGER: 1
TRUENAS-MIB::zpoolIndex.2 = INTEGER: 2
TRUENAS-MIB::zpoolIndex.3 = INTEGER: 3
TRUENAS-MIB::zpoolName.1 = STRING: boot-pool
TRUENAS-MIB::zpoolName.2 = STRING: fast
TRUENAS-MIB::zpoolName.3 = STRING: rust
TRUENAS-MIB::zpoolHealth.1 = STRING: ONLINE
TRUENAS-MIB::zpoolHealth.2 = STRING: ONLINE
TRUENAS-MIB::zpoolHealth.3 = STRING: ONLINE

You will need the TrueNAS MIB file, either from /usr/local/share/snmp/mibs/TRUENAS-MIB.txt on a TrueNAS install or from the file linked on this page.

If you have a shell on TrueNAS, you can use the following command to list all TrueNAS specific information:

snmpwalk -c public -v2c 127.0.0.1 -M +/usr/local/share/snmp/mibs -m +TRUENAS-MIB trueNas

I don’t think SMART data is available via SNMP. I do recommend setting up TrueNAS alerts in System → Alert Settings.

SMART data definitely isn’t exposed by SNMP, and last time I checked the TrueNAS ZFS stuff was pretty broken in SNMP, too. I monitor my server using librenms and most of the state objects actually appear to be exposing counters for something.

Sadly there appears to be something of a trend away from “enterprise” vendors exposing useful reporting data via SNMP, and instead relying on their own monitoring tools.