zabbix_export: version: '6.0' date: '2022-01-26T10:32:29Z' groups: - uuid: 57b7ae836ca64446ba2c296389c009b7 name: Templates/Modules templates: - uuid: e518b1340ce44d7389d2cc7c304a97b4 template: 'SMART by Zabbix agent 2 active' name: 'SMART by Zabbix agent 2 active' description: | The template for monitoring S.M.A.R.T. attributes of physical disk that works without any external scripts. It collects metrics by Zabbix agent 2 version 5.0 and later with Smartmontools version 7.1 and later. Disk discovery LLD rule finds all HDD, SSD, NVMe disks with S.M.A.R.T. enabled. Attribute discovery LLD rule finds all Vendor Specific Attributes for each disk. If you want to skip some attributes, please set regular expressions with disk names in {$SMART.DISK.NAME.MATCHES} and with attribute IDs in {$SMART.ATTRIBUTE.ID.MATCHES} macros on the host level. You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/415662-discussion-thread-for-official-zabbix-smart-disk-monitoring Template tooling version used: 0.41 groups: - name: Templates/Modules items: - uuid: feba508d76b845039b434f62d9e62d54 name: 'SMART: Get attributes' type: ZABBIX_ACTIVE key: smart.disk.get history: '0' trends: '0' value_type: TEXT tags: - tag: component value: raw - tag: component value: storage discovery_rules: - uuid: 3b19696e4d8f4f98acb40481adfa7513 name: 'Attribute discovery' type: ZABBIX_ACTIVE key: smart.attribute.discovery delay: 1h description: 'Discovery SMART Vendor Specific Attributes of disks.' item_prototypes: - uuid: 5c09ba32ad72321bce5042d5f4dc59d2 name: 'SMART [{#NAME}]: ID {#ID} {#ATTRNAME} raw value' type: DEPENDENT key: 'smart.disk.attr.raw[{#NAME},{#ID}]' delay: '0' history: 7d trends: '0' value_type: CHAR preprocessing: - type: JSONPATH parameters: - '$[?(@.disk_name==''{#NAME}'')].ata_smart_attributes.table[?(@.id=={#ID})].raw.string.first()' - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - 6h master_item: key: smart.disk.get tags: - tag: component value: storage - tag: diskname value: '{#NAME}' - tag: disktype value: '{#DISKTYPE}' - uuid: 498a4f1b4b7442b5a38c52400646cc47 name: 'SMART [{#NAME}]: ID {#ID} {#ATTRNAME}' type: DEPENDENT key: 'smart.disk.error[{#NAME},{#ID}]' delay: '0' history: 7d preprocessing: - type: JSONPATH parameters: - '$[?(@.disk_name==''{#NAME}'')].ata_smart_attributes.table[?(@.id=={#ID})].value.first()' - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - 6h master_item: key: smart.disk.get tags: - tag: component value: storage - tag: diskname value: '{#NAME}' - tag: disktype value: '{#DISKTYPE}' trigger_prototypes: - uuid: 26a3e4a0b79340b1bb753ec23c07c79b expression: 'last(/SMART by Zabbix agent 2 active/smart.disk.error[{#NAME},{#ID}]) <= {#THRESH}' name: 'SMART [{#NAME}]: Attribute {#ID} {#ATTRNAME} is failed' priority: WARNING description: 'The value should be greater than THRESH.' tags: - tag: scope value: notice overrides: - name: 'ID filter' step: '1' filter: conditions: - macro: '{#ID}' value: '{$SMART.ATTRIBUTE.ID.MATCHES}' formulaid: A - macro: '{#NAME}' value: '{$SMART.DISK.NAME.MATCHES}' formulaid: B operations: - operationobject: ITEM_PROTOTYPE operator: REGEXP status: ENABLED discover: NO_DISCOVER - uuid: 0a56a348d4a446938beae1eae5ec8993 name: 'Disk discovery' type: ZABBIX_ACTIVE key: smart.disk.discovery delay: 1h description: 'Discovery SMART disks.' item_prototypes: - uuid: ad6a9f6f7293495c916bb0aac0bc9729 name: 'SMART [{#NAME}]: Critical warning' type: DEPENDENT key: 'smart.disk.critical_warning[{#NAME}]' delay: '0' history: 7d description: 'This field indicates critical warnings for the state of the controller.' preprocessing: - type: JSONPATH parameters: - '$[?(@.disk_name==''{#NAME}'')].nvme_smart_health_information_log.critical_warning.first()' - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - 6h master_item: key: smart.disk.get tags: - tag: component value: storage - tag: diskname value: '{#NAME}' - tag: disktype value: '{#DISKTYPE}' - uuid: e5bbd606e330469389bf081588b88d17 name: 'SMART [{#NAME}]: Power on hours' type: DEPENDENT key: 'smart.disk.hours[{#NAME}]' delay: '0' history: 7d description: 'Count of hours in power-on state. The raw value of this attribute shows total count of hours (or minutes, or seconds, depending on manufacturer) in power-on state. "By default, the total expected lifetime of a hard disk in perfect condition is defined as 5 years (running every day and night on all days). This is equal to 1825 days in 24/7 mode or 43800 hours." On some pre-2005 drives, this raw value may advance erratically and/or "wrap around" (reset to zero periodically). https://en.wikipedia.org/wiki/S.M.A.R.T.#Known_ATA_S.M.A.R.T._attributes' preprocessing: - type: JSONPATH parameters: - '$[?(@.disk_name==''{#NAME}'')].power_on_time.hours.first()' - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - 6h master_item: key: smart.disk.get tags: - tag: component value: storage - tag: diskname value: '{#NAME}' - tag: disktype value: '{#DISKTYPE}' - uuid: 0861b008b09a41799978e085625aaa4a name: 'SMART [{#NAME}]: Media errors' type: DEPENDENT key: 'smart.disk.media_errors[{#NAME}]' delay: '0' history: 7d description: 'Contains the number of occurrences where the controller detected an unrecovered data integrity error. Errors such as uncorrectable ECC, CRC checksum failure, or LBA tag mismatch are included in this field.' preprocessing: - type: JSONPATH parameters: - '$[?(@.disk_name==''{#NAME}'')].nvme_smart_health_information_log.media_errors.first()' - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - 6h master_item: key: smart.disk.get tags: - tag: component value: storage - tag: diskname value: '{#NAME}' - tag: disktype value: '{#DISKTYPE}' - uuid: f48fe3366b194eb4942411cc776c8633 name: 'SMART [{#NAME}]: Device model' type: DEPENDENT key: 'smart.disk.model[{#NAME}]' delay: '0' history: 7d trends: '0' value_type: CHAR preprocessing: - type: JSONPATH parameters: - '$[?(@.disk_name==''{#NAME}'')].model_name.first()' - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - 6h master_item: key: smart.disk.get tags: - tag: component value: inventory - tag: diskname value: '{#NAME}' - tag: disktype value: '{#DISKTYPE}' - uuid: d5cef21c49994c3e8e12ef6471d7cdcd name: 'SMART [{#NAME}]: Percentage used' type: DEPENDENT key: 'smart.disk.percentage_used[{#NAME}]' delay: '0' history: 7d units: '%' description: 'Contains a vendor specific estimate of the percentage of NVM subsystem life used based on the actual usage and the manufacturer''s prediction of NVM life. A value of 100 indicates that the estimated endurance of the NVM in the NVM subsystem has been consumed, but may not indicate an NVM subsystem failure. The value is allowed to exceed 100. Percentages greater than 254 shall be represented as 255. This value shall be updated once per power-on hour (when the controller is not in a sleep state).' preprocessing: - type: JSONPATH parameters: - '$[?(@.disk_name==''{#NAME}'')].nvme_smart_health_information_log.percentage_used.first()' - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - 6h master_item: key: smart.disk.get tags: - tag: component value: storage - tag: diskname value: '{#NAME}' - tag: disktype value: '{#DISKTYPE}' trigger_prototypes: - uuid: 68f373252bee4f9e8f3b33d04fc1adbd expression: 'last(/SMART by Zabbix agent 2 active/smart.disk.percentage_used[{#NAME}])>90' name: 'SMART [{#NAME}]: NVMe disk percentage using is over 90% of estimated endurance' priority: AVERAGE tags: - tag: scope value: notice - uuid: 189d8e8d16ed40229ba3ca52b75d2dc4 name: 'SMART [{#NAME}]: Serial number' type: DEPENDENT key: 'smart.disk.sn[{#NAME}]' delay: '0' history: 7d trends: '0' value_type: CHAR preprocessing: - type: JSONPATH parameters: - '$[?(@.disk_name==''{#NAME}'')].serial_number.first()' - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - 6h master_item: key: smart.disk.get tags: - tag: component value: inventory - tag: diskname value: '{#NAME}' - tag: disktype value: '{#DISKTYPE}' trigger_prototypes: - uuid: 2d5cf100fe094c819d725ee598d37de8 expression: 'last(/SMART by Zabbix agent 2 active/smart.disk.sn[{#NAME}],#1)<>last(/SMART by Zabbix agent 2 active/smart.disk.sn[{#NAME}],#2) and length(last(/SMART by Zabbix agent 2 active/smart.disk.sn[{#NAME}]))>0' name: 'SMART [{#NAME}]: Disk has been replaced (new serial number received)' priority: INFO description: 'Device serial number has changed. Ack to close.' manual_close: 'YES' tags: - tag: scope value: notice - uuid: e79eaaf7ee0d40e7b91fc019f5edb19e name: 'SMART [{#NAME}]: Temperature' type: DEPENDENT key: 'smart.disk.temperature[{#NAME}]' delay: '0' history: 7d units: °C description: 'Current drive temperature.' preprocessing: - type: JSONPATH parameters: - '$[?(@.disk_name==''{#NAME}'')].temperature.current.first()' - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - 6h master_item: key: smart.disk.get tags: - tag: component value: temperature - tag: diskname value: '{#NAME}' - tag: disktype value: '{#DISKTYPE}' trigger_prototypes: - uuid: 7f46b24934854866849dd758cb5999d5 expression: 'avg(/SMART by Zabbix agent 2 active/smart.disk.temperature[{#NAME}],5m)>{$SMART.TEMPERATURE.MAX.CRIT}' name: 'SMART [{#NAME}]: Average disk temperature is critical (over {$SMART.TEMPERATURE.MAX.CRIT}°C for 5m)' priority: AVERAGE tags: - tag: scope value: notice - uuid: c903a37f4b004e1593ef85ac893c3f6c expression: 'avg(/SMART by Zabbix agent 2 active/smart.disk.temperature[{#NAME}],5m)>{$SMART.TEMPERATURE.MAX.WARN}' name: 'SMART [{#NAME}]: Average disk temperature is too high (over {$SMART.TEMPERATURE.MAX.WARN}°C for 5m)' priority: WARNING dependencies: - name: 'SMART [{#NAME}]: Average disk temperature is critical (over {$SMART.TEMPERATURE.MAX.CRIT}°C for 5m)' expression: 'avg(/SMART by Zabbix agent 2 active/smart.disk.temperature[{#NAME}],5m)>{$SMART.TEMPERATURE.MAX.CRIT}' tags: - tag: scope value: notice - uuid: 2475415cc95b4103b2933f921e62dd36 name: 'SMART [{#NAME}]: Self-test passed' type: DEPENDENT key: 'smart.disk.test[{#NAME}]' delay: '0' history: 7d trends: '0' value_type: CHAR description: 'The disk is passed the SMART self-test or not.' preprocessing: - type: JSONPATH parameters: - '$[?(@.disk_name==''{#NAME}'')].ata_smart_data.self_test.status.passed.first()' - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - 6h master_item: key: smart.disk.get tags: - tag: component value: health - tag: diskname value: '{#NAME}' - tag: disktype value: '{#DISKTYPE}' trigger_prototypes: - uuid: 304bd042b7644a31bb74a1e71808d196 expression: 'last(/SMART by Zabbix agent 2 active/smart.disk.test[{#NAME}])="false"' name: 'SMART [{#NAME}]: Disk self-test is not passed' priority: HIGH tags: - tag: scope value: notice overrides: - name: 'Not NVMe' step: '2' filter: conditions: - macro: '{#DISKTYPE}' value: nvme operator: NOT_MATCHES_REGEX formulaid: A operations: - operationobject: ITEM_PROTOTYPE operator: REGEXP value: Media|Percentage|Critical status: ENABLED discover: NO_DISCOVER - name: Self-test step: '1' filter: conditions: - macro: '{#DISKTYPE}' value: nvme formulaid: A operations: - operationobject: ITEM_PROTOTYPE operator: LIKE value: Self-test status: ENABLED discover: NO_DISCOVER macros: - macro: '{$SMART.ATTRIBUTE.ID.MATCHES}' value: CHANGE_IF_NEEDED description: 'This macro is used in overrides of attribute discovery for filtering IDs. It can be overridden on the host or linked template level.' - macro: '{$SMART.DISK.NAME.MATCHES}' value: CHANGE_IF_NEEDED description: 'This macro is used in overrides of attribute discovery for filtering IDs. It can be overridden on the host or linked template level.' - macro: '{$SMART.TEMPERATURE.MAX.CRIT}' value: '65' description: 'This macro is used for trigger expression. It can be overridden on the host or linked template level.' - macro: '{$SMART.TEMPERATURE.MAX.WARN}' value: '50' description: 'This macro is used for trigger expression. It can be overridden on the host or linked template level.'