zabbix_export:
  version: '7.0'
  template_groups:
    - uuid: e960332b3f6c46a1956486d4f3f99fce
      name: 'Templates/Server hardware'
  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 have pre-defined Vendor Specific Attributes for each disk, and will be discovered if attribute is present.
        
        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
        
        Generated by official Zabbix template tool "Templator"
      vendor:
        name: Zabbix
        version: 7.0-0
      groups:
        - name: 'Templates/Server hardware'
      discovery_rules:
        - uuid: 0a56a348d4a446938beae1eae5ec8993
          name: 'Disk discovery'
          type: ZABBIX_ACTIVE
          key: smart.disk.discovery
          delay: 1h
          filter:
            evaltype: AND
            conditions:
              - macro: '{#NAME}'
                value: '{$SMART.DISK.NAME.MATCHES}'
              - macro: '{#NAME}'
                value: '{$SMART.DISK.NAME.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
          description: 'Discovery SMART disks.'
          item_prototypes:
            - uuid: b3891b80915c4e2488f2f87cb173474a
              name: 'SMART [{#NAME}]: Bad_Block_Rate'
              type: DEPENDENT
              key: 'smart.disk.attribute.bad_block_rate[{#NAME}]'
              discover: NO_DISCOVER
              description: 'Percentage of used reserve blocks divided by total reserve blocks.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.bad_block_rate.value
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'smart.disk.get[{#PATH},"{#RAIDTYPE}"]'
              tags:
                - tag: component
                  value: attribute
                - tag: component
                  value: storage
                - tag: diskname
                  value: '{#NAME}'
                - tag: disktype
                  value: '{#DISKTYPE}'
            - uuid: 512c44706bff48fda2ef444713d93b29
              name: 'SMART [{#NAME}]: Power_Cycle_Count'
              type: DEPENDENT
              key: 'smart.disk.attribute.power_cycle_count[{#NAME}]'
              discover: NO_DISCOVER
              description: 'This attribute indicates the count of full hard disk power on/off cycles.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.power_cycle_count.value
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'smart.disk.get[{#PATH},"{#RAIDTYPE}"]'
              tags:
                - tag: component
                  value: attribute
                - tag: component
                  value: storage
                - tag: diskname
                  value: '{#NAME}'
                - tag: disktype
                  value: '{#DISKTYPE}'
            - uuid: 0ab9412116924ca2a9561b44e4c9d6da
              name: 'SMART [{#NAME}]: Program_Fail_Count_Chip'
              type: DEPENDENT
              key: 'smart.disk.attribute.program_fail_count_chip[{#NAME}]'
              discover: NO_DISCOVER
              description: 'The total number of flash program operation failures since the drive was deployed.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.program_fail_count_chip.value
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'smart.disk.get[{#PATH},"{#RAIDTYPE}"]'
              tags:
                - tag: component
                  value: attribute
                - tag: component
                  value: storage
                - tag: diskname
                  value: '{#NAME}'
                - tag: disktype
                  value: '{#DISKTYPE}'
            - uuid: f794dc07c88a4690be8512e029f0b50c
              name: 'SMART [{#NAME}]: Raw_Read_Error_Rate'
              type: DEPENDENT
              key: 'smart.disk.attribute.raw_read_error_rate[{#NAME}]'
              discover: NO_DISCOVER
              description: 'Stores data related to the rate of hardware read errors that occurred when reading data from a disk surface. The raw value has different structure for different vendors and is often not meaningful as a decimal number. For some drives, this number may increase during normal operation without necessarily signifying errors.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.raw_read_error_rate.value
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'smart.disk.get[{#PATH},"{#RAIDTYPE}"]'
              tags:
                - tag: component
                  value: attribute
                - tag: component
                  value: storage
                - tag: diskname
                  value: '{#NAME}'
                - tag: disktype
                  value: '{#DISKTYPE}'
            - uuid: 643276ac0dab47b8974e849a1574ac2a
              name: 'SMART [{#NAME}]: Reallocated_Sector_Ct'
              type: DEPENDENT
              key: 'smart.disk.attribute.reallocated_sector_ct[{#NAME}]'
              discover: NO_DISCOVER
              description: 'Disk discovered attribute.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.reallocated_sector_ct.value
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'smart.disk.get[{#PATH},"{#RAIDTYPE}"]'
              tags:
                - tag: component
                  value: attribute
                - tag: component
                  value: storage
                - tag: diskname
                  value: '{#NAME}'
                - tag: disktype
                  value: '{#DISKTYPE}'
            - uuid: fa253069f1c74a0b9ee3dca5eafef17a
              name: 'SMART [{#NAME}]: Reported_Uncorrect'
              type: DEPENDENT
              key: 'smart.disk.attribute.reported_uncorrect[{#NAME}]'
              discover: NO_DISCOVER
              description: 'The count of errors that could not be recovered using hardware ECC.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.reported_uncorrect.value
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'smart.disk.get[{#PATH},"{#RAIDTYPE}"]'
              tags:
                - tag: component
                  value: attribute
                - tag: component
                  value: storage
                - tag: diskname
                  value: '{#NAME}'
                - tag: disktype
                  value: '{#DISKTYPE}'
            - uuid: 99df8858bc6d4fb4a9fb4abd29b6c852
              name: 'SMART [{#NAME}]: Seek_Error_Rate'
              type: DEPENDENT
              key: 'smart.disk.attribute.seek_error_rate[{#NAME}]'
              discover: NO_DISCOVER
              description: 'Rate of seek errors of the magnetic heads. If there is a partial failure in the mechanical positioning system, then seek errors will arise. Such a failure may be due to numerous factors, such as damage to a servo, or thermal widening of the hard disk. The raw value has different structure for different vendors and is often not meaningful as a decimal number. For some drives, this number may increase during normal operation without necessarily signifying errors.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.seek_error_rate.value
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'smart.disk.get[{#PATH},"{#RAIDTYPE}"]'
              tags:
                - tag: component
                  value: attribute
                - tag: component
                  value: storage
                - tag: diskname
                  value: '{#NAME}'
                - tag: disktype
                  value: '{#DISKTYPE}'
            - uuid: 422ba65b87444329b5a23d03ce89dda7
              name: 'SMART [{#NAME}]: Spin_Up_Time'
              type: DEPENDENT
              key: 'smart.disk.attribute.spin_up_time[{#NAME}]'
              discover: NO_DISCOVER
              description: 'Average time of spindle spin up (from zero RPM to fully operational [milliseconds]).'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.spin_up_time.value
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'smart.disk.get[{#PATH},"{#RAIDTYPE}"]'
              tags:
                - tag: component
                  value: attribute
                - tag: component
                  value: storage
                - tag: diskname
                  value: '{#NAME}'
                - tag: disktype
                  value: '{#DISKTYPE}'
            - uuid: eee36c13fc6248f6894188102d215638
              name: 'SMART [{#NAME}]: Start_Stop_Count'
              type: DEPENDENT
              key: 'smart.disk.attribute.start_stop_count[{#NAME}]'
              discover: NO_DISCOVER
              description: 'A tally of spindle start/stop cycles. The spindle turns on, and hence the count is increased, both when the hard disk is turned on after having before been turned entirely off (disconnected from power source) and when the hard disk returns from having previously been put to sleep mode.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.start_stop_count.value
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'smart.disk.get[{#PATH},"{#RAIDTYPE}"]'
              tags:
                - tag: component
                  value: attribute
                - tag: component
                  value: storage
                - tag: diskname
                  value: '{#NAME}'
                - tag: disktype
                  value: '{#DISKTYPE}'
            - uuid: ad6a9f6f7293495c916bb0aac0bc9729
              name: 'SMART [{#NAME}]: Critical warning'
              type: DEPENDENT
              key: 'smart.disk.critical_warning[{#NAME}]'
              description: 'This field indicates critical warnings for the state of the controller.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.critical_warning
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'smart.disk.get[{#PATH},"{#RAIDTYPE}"]'
              tags:
                - tag: component
                  value: storage
                - tag: diskname
                  value: '{#NAME}'
                - tag: disktype
                  value: '{#DISKTYPE}'
            - uuid: b96b496a854f4165a44662bd93400b27
              name: 'SMART [{#NAME}]: Smartctl error'
              type: DEPENDENT
              key: 'smart.disk.error[{#NAME}]'
              value_type: TEXT
              description: 'This metric will contain smartctl errors.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.error
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'smart.disk.get[{#PATH},"{#RAIDTYPE}"]'
              tags:
                - tag: component
                  value: storage
                - tag: diskname
                  value: '{#NAME}'
                - tag: disktype
                  value: '{#DISKTYPE}'
            - uuid: 952376ecd47a498cab40ec6872d20454
              name: 'SMART [{#NAME}]: Exit status'
              type: DEPENDENT
              key: 'smart.disk.es[{#NAME}]'
              description: |
                The exit statuses of smartctl are defined by a bitmask but in decimal value. The eight different bits in the exit status have the following  meanings  for  ATA disks; some of these values may also be returned for SCSI disks.
                Bit 0: Command line did not parse.
                Bit 1: Device  open failed, device did not return an IDENTIFY DEVICE structure, or device is in a low-power mode (see '-n' option above).
                Bit 2: Some SMART or other ATA command to the disk failed, or there was a checksum error in a SMART data  structure  (see '-b' option above).
                Bit 3: SMART status check returned "DISK FAILING".
                Bit 4: We found prefail Attributes <= threshold.
                Bit 5: SMART  status  check returned "DISK OK" but we found that some (usage or prefail) Attributes have been <= threshold at some time in the past.
                Bit 6: The device error log contains records of errors.
                Bit 7: The device self-test log contains records of errors. [ATA only] Failed self-tests outdated by a newer successful extended self-test are ignored.
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.exit_status
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'smart.disk.get[{#PATH},"{#RAIDTYPE}"]'
              tags:
                - tag: component
                  value: storage
                - tag: diskname
                  value: '{#NAME}'
                - tag: disktype
                  value: '{#DISKTYPE}'
              trigger_prototypes:
                - uuid: ec00e4aa70fa4bea92c559e145ca2e18
                  expression: |
                    ( count(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}],#2) = 1 and bitand(last(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}]),8) = 8 )
                    or ( bitand(last(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}]),8) = 8
                    and bitand(last(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}]),8) > bitand(last(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}],#2),8) )
                  recovery_mode: NONE
                  name: 'SMART [{#NAME}]: Check returned "DISK FAILING"'
                  priority: HIGH
                  description: 'SMART status check returned "DISK FAILING".'
                  manual_close: 'YES'
                  tags:
                    - tag: scope
                      value: notice
                - uuid: 612c964798d74ab2af23cc6ec5a1d754
                  expression: |
                    ( count(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}],#2) = 1 and bitand(last(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}]),1) = 1 )
                    or ( bitand(last(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}]),1) = 1
                    and bitand(last(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}]),1) > bitand(last(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}],#2),1) )
                  recovery_mode: NONE
                  name: 'SMART [{#NAME}]: Command line did not parse'
                  priority: HIGH
                  description: 'Command line did not parse.'
                  manual_close: 'YES'
                  tags:
                    - tag: scope
                      value: notice
                - uuid: 3591c8077a894f6b8deaaf8055ca940e
                  expression: |
                    ( count(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}],#2) = 1 and bitand(last(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}]),2) = 2 )
                    or ( bitand(last(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}]),2) = 2
                    and bitand(last(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}]),2) > bitand(last(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}],#2),2) )
                  recovery_mode: NONE
                  name: 'SMART [{#NAME}]: Device open failed'
                  priority: HIGH
                  description: 'Device open failed, device did not return an IDENTIFY DEVICE structure, or device is in a low-power mode.'
                  manual_close: 'YES'
                  tags:
                    - tag: scope
                      value: notice
                - uuid: b524364e077a4f898a93af34ef4e6e7f
                  expression: |
                    ( count(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}],#2) = 1 and bitand(last(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}]),64) = 64 )
                    or ( bitand(last(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}]),64) = 64
                    and bitand(last(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}]),64) > bitand(last(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}],#2),64) )
                  recovery_mode: NONE
                  name: 'SMART [{#NAME}]: Error log contains records'
                  priority: HIGH
                  description: 'The device error log contains records of errors.'
                  manual_close: 'YES'
                  tags:
                    - tag: scope
                      value: notice
                - uuid: 5e56f837d39b49a89d1f6ca3c45b5737
                  expression: |
                    ( count(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}],#2) = 1 and bitand(last(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}]),128) = 128 )
                    or ( bitand(last(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}]),128) = 128
                    and bitand(last(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}]),128) > bitand(last(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}],#2),128) )
                  recovery_mode: NONE
                  name: 'SMART [{#NAME}]: Self-test log contains records'
                  priority: HIGH
                  description: |
                    The device self-test log contains records of errors. [ATA only]
                    Failed self-tests outdated by a newer successful extended self-test are ignored.
                  manual_close: 'YES'
                  tags:
                    - tag: scope
                      value: notice
                - uuid: 541318ea2fd14fb4a6f8e8a8df1e4d36
                  expression: |
                    ( count(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}],#2) = 1 and bitand(last(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}]),32) = 32 )
                    or ( bitand(last(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}]),32) = 32
                    and bitand(last(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}]),32) > bitand(last(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}],#2),32) )
                  recovery_mode: NONE
                  name: 'SMART [{#NAME}]: Some Attributes have been <= threshold'
                  priority: HIGH
                  description: |
                    SMART status check returned "DISK OK" but we found that some (usage
                    or prefail) Attributes have been <= threshold at some time in the past.
                  manual_close: 'YES'
                  tags:
                    - tag: scope
                      value: notice
                - uuid: 00eba731f9ae495f9fe38020897c9aef
                  expression: |
                    ( count(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}],#2) = 1 and bitand(last(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}]),4) = 4 )
                    or ( bitand(last(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}]),4) = 4
                    and bitand(last(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}]),4) > bitand(last(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}],#2),4) )
                  recovery_mode: NONE
                  name: 'SMART [{#NAME}]: Some command to the disk failed'
                  priority: HIGH
                  description: |
                    Some SMART or other ATA command to the disk failed,
                    or there was a checksum error in a SMART data structure.
                  manual_close: 'YES'
                  tags:
                    - tag: scope
                      value: notice
                - uuid: 04dc576b815e432a9cf6d8fee6b08bae
                  expression: |
                    ( count(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}],#2) = 1 and bitand(last(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}]),16) = 16 )
                    or ( bitand(last(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}]),16) = 16
                    and bitand(last(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}]),16) > bitand(last(/SMART by Zabbix agent 2 active/smart.disk.es[{#NAME}],#2),16) )
                  recovery_mode: NONE
                  name: 'SMART [{#NAME}]: Some prefail Attributes <= threshold'
                  priority: HIGH
                  description: 'We found prefail Attributes <= threshold.'
                  manual_close: 'YES'
                  tags:
                    - tag: scope
                      value: notice
            - uuid: b26489a8ba12495dbb9687ef52ab1396
              name: 'SMART [{#NAME}]: Get disk attributes'
              type: ZABBIX_ACTIVE
              key: 'smart.disk.get[{#PATH},"{#RAIDTYPE}"]'
              history: '0'
              value_type: TEXT
              tags:
                - tag: component
                  value: raw
                - tag: component
                  value: storage
            - uuid: e5bbd606e330469389bf081588b88d17
              name: 'SMART [{#NAME}]: Power on hours'
              type: DEPENDENT
              key: 'smart.disk.hours[{#NAME}]'
              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:
                    - $.power_on_time
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'smart.disk.get[{#PATH},"{#RAIDTYPE}"]'
              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}]'
              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:
                    - $.media_errors
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'smart.disk.get[{#PATH},"{#RAIDTYPE}"]'
              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}]'
              value_type: CHAR
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.model_name
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'smart.disk.get[{#PATH},"{#RAIDTYPE}"]'
              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}]'
              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:
                    - $.percentage_used
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'smart.disk.get[{#PATH},"{#RAIDTYPE}"]'
              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}]'
              value_type: CHAR
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.serial_number
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'smart.disk.get[{#PATH},"{#RAIDTYPE}"]'
              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'
                  event_name: 'SMART [{#NAME}]: Disk has been replaced (new serial number received)'
                  priority: INFO
                  description: 'Device serial number has changed. Acknowledge to close the problem manually.'
                  manual_close: 'YES'
                  tags:
                    - tag: scope
                      value: notice
            - uuid: e79eaaf7ee0d40e7b91fc019f5edb19e
              name: 'SMART [{#NAME}]: Temperature'
              type: DEPENDENT
              key: 'smart.disk.temperature[{#NAME}]'
              units: °C
              description: 'Current drive temperature.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.temperature
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'smart.disk.get[{#PATH},"{#RAIDTYPE}"]'
              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'
                  event_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'
                  event_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'
                      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}]'
              value_type: CHAR
              description: 'The disk is passed the SMART self-test or not.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.self_test_passed
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'smart.disk.get[{#PATH},"{#RAIDTYPE}"]'
              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: Self-test
              step: '1'
              filter:
                conditions:
                  - macro: '{#DISKTYPE}'
                    value: nvme
              operations:
                - operator: LIKE
                  value: Self-test
                  discover: NO_DISCOVER
            - name: 'Not NVMe'
              step: '2'
              filter:
                conditions:
                  - macro: '{#DISKTYPE}'
                    value: nvme
                    operator: NOT_MATCHES_REGEX
              operations:
                - operator: REGEXP
                  value: Media|Percentage|Critical
                  discover: NO_DISCOVER
            - name: Raw_Read_Error_Rate
              step: '3'
              filter:
                conditions:
                  - macro: '{#ATTRIBUTES}'
                    value: Raw_Read_Error_Rate
              operations:
                - operator: REGEXP
                  value: Raw_Read_Error_Rate
                  discover: DISCOVER
            - name: Spin_Up_Time
              step: '4'
              filter:
                conditions:
                  - macro: '{#ATTRIBUTES}'
                    value: Spin_Up_Time
              operations:
                - operator: REGEXP
                  value: Spin_Up_Time
                  discover: DISCOVER
            - name: Start_Stop_Count
              step: '5'
              filter:
                conditions:
                  - macro: '{#ATTRIBUTES}'
                    value: Start_Stop_Count
              operations:
                - operator: REGEXP
                  value: Start_Stop_Count
                  discover: DISCOVER
            - name: Power_Cycle_Count
              step: '6'
              filter:
                conditions:
                  - macro: '{#ATTRIBUTES}'
                    value: Power_Cycle_Count
              operations:
                - operator: REGEXP
                  value: Power_Cycle_Count
                  discover: DISCOVER
            - name: Reported_Uncorrect
              step: '7'
              filter:
                conditions:
                  - macro: '{#ATTRIBUTES}'
                    value: Reported_Uncorrect
              operations:
                - operator: REGEXP
                  value: Reported_Uncorrect
                  discover: DISCOVER
            - name: Seek_Error_Rate
              step: '8'
              filter:
                conditions:
                  - macro: '{#ATTRIBUTES}'
                    value: Seek_Error_Rate
              operations:
                - operator: REGEXP
                  value: Seek_Error_Rate
                  discover: DISCOVER
            - name: Bad_Block_Rate
              step: '9'
              filter:
                conditions:
                  - macro: '{#ATTRIBUTES}'
                    value: Bad_Block_Rate
              operations:
                - operator: REGEXP
                  value: Bad_Block_Rate
                  discover: DISCOVER
            - name: Program_Fail_Count_Chip
              step: '10'
              filter:
                conditions:
                  - macro: '{#ATTRIBUTES}'
                    value: Program_Fail_Count_Chip
              operations:
                - operator: REGEXP
                  value: Program_Fail_Count_Chip
                  discover: DISCOVER
            - name: Reallocated_Sector_Ct
              step: '11'
              filter:
                conditions:
                  - macro: '{#ATTRIBUTES}'
                    value: Reallocated_Sector_Ct
              operations:
                - operator: REGEXP
                  value: Reallocated_Sector_Ct
                  discover: DISCOVER
      tags:
        - tag: class
          value: storage
        - tag: target
          value: hdd
        - tag: target
          value: ssd
      macros:
        - macro: '{$SMART.DISK.NAME.MATCHES}'
          value: '^.*$'
          description: 'This macro is used in the filter of attribute and disk discoveries. It can be overridden on the host or linked on the template level.'
        - macro: '{$SMART.DISK.NAME.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'This macro is used in the filter of attribute and disk discoveries. It can be overridden on the host or linked on the 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 on the 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 on the template level.'
      dashboards:
        - uuid: 3168a06be7744331b78574fbbc28826e
          name: 'SMART: Overview'
          pages:
            - name: Temperature
              widgets:
                - type: graphprototype
                  width: '72'
                  height: '20'
                  fields:
                    - type: ITEM_PROTOTYPE
                      name: itemid.0
                      value:
                        host: 'SMART by Zabbix agent 2 active'
                        key: 'smart.disk.temperature[{#NAME}]'
                    - type: STRING
                      name: reference
                      value: AAAAA
                    - type: INTEGER
                      name: rows
                      value: '5'
                    - type: INTEGER
                      name: source_type
                      value: '3'
            - name: 'Power On'
              widgets:
                - type: graphprototype
                  width: '72'
                  height: '20'
                  fields:
                    - type: ITEM_PROTOTYPE
                      name: itemid.0
                      value:
                        host: 'SMART by Zabbix agent 2 active'
                        key: 'smart.disk.hours[{#NAME}]'
                    - type: STRING
                      name: reference
                      value: AAAAB
                    - type: INTEGER
                      name: rows
                      value: '5'
                    - type: INTEGER
                      name: source_type
                      value: '3'
