zabbix_export:
  version: '8.0'
  host_groups:
    - uuid: 87f5e92a46fb4336b9a84de287a34876
      name: 'Test hosts'
  hosts:
    - host: 'test vfs.dev.get device_stats'
      name: 'test vfs.dev.get device_stats'
      groups:
        - name: 'Test hosts'
      interfaces:
        - interface_ref: if1
      items:
        - name: 'vfs.dev.get[device_stats] master item'
          key: 'vfs.dev.get[device_stats]'
          history: '0'
          value_type: TEXT
          interface_ref: if1
      discovery_rules:
        - name: 'Discovery rule for vfs.dev.get disk_stats'
          type: DEPENDENT
          key: vfs.dev.get.drule
          filter:
            conditions:
              - macro: '{#DEVNAME}'
                value: '^loop.*'
                operator: NOT_MATCHES_REGEX
          item_prototypes:
            - name: '[{#DEVNAME}] [config] name'
              type: DEPENDENT
              key: 'vfs.fs.get.config.name[{#DEVNAME}]'
              value_type: TEXT
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.config.[?(@.name==''{#DEVNAME}'')].name.first()'
              master_item:
                key: 'vfs.dev.get[device_stats]'
            - name: '[{#DEVNAME}] [config] devid'
              type: DEPENDENT
              key: 'vfs.fs.get.devid[{#DEVNAME}]'
              value_type: TEXT
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.config.[?(@.name==''{#DEVNAME}'')].devid.first()'
              master_item:
                key: 'vfs.dev.get[device_stats]'
            - name: '[{#DEVNAME}] [config] size in bytes'
              type: DEPENDENT
              key: 'vfs.fs.get.size_bytes[{#DEVNAME}]'
              trends: '0'
              units: B
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.config.[?(@.name==''{#DEVNAME}'')].size_bytes.first()'
              master_item:
                key: 'vfs.dev.get[device_stats]'
            - name: '[{#DEVNAME}] [values] stats.bytes_read'
              type: DEPENDENT
              key: 'vfs.fs.get.stats.bytes_read[{#DEVNAME}]'
              trends: '0'
              units: B
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.values.[?(@.name==''{#DEVNAME}'')].stats.bytes_read.first()'
              master_item:
                key: 'vfs.dev.get[device_stats]'
            - name: '[{#DEVNAME}] [values] stats.bytes_written'
              type: DEPENDENT
              key: 'vfs.fs.get.stats.bytes_written[{#DEVNAME}]'
              trends: '0'
              units: B
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.values.[?(@.name==''{#DEVNAME}'')].stats.bytes_written.first()'
              master_item:
                key: 'vfs.dev.get[device_stats]'
            - name: '[{#DEVNAME}] [values] stats.io_time_ms'
              type: DEPENDENT
              key: 'vfs.fs.get.stats.io_time_ms[{#DEVNAME}]'
              trends: '0'
              units: ms
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.values.[?(@.name==''{#DEVNAME}'')].stats.io_time_ms.first()'
              master_item:
                key: 'vfs.dev.get[device_stats]'
            - name: '[{#DEVNAME}] [values] stats.reads_completed'
              type: DEPENDENT
              key: 'vfs.fs.get.stats.reads_completed[{#DEVNAME}]'
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.values.[?(@.name==''{#DEVNAME}'')].stats.reads_completed.first()'
              master_item:
                key: 'vfs.dev.get[device_stats]'
            - name: '[{#DEVNAME}] [values] stats.writes_completed'
              type: DEPENDENT
              key: 'vfs.fs.get.stats.writes_completed[{#DEVNAME}]'
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.values.[?(@.name==''{#DEVNAME}'')].stats.writes_completed.first()'
              master_item:
                key: 'vfs.dev.get[device_stats]'
            - name: '[{#DEVNAME}] [config] type'
              type: DEPENDENT
              key: 'vfs.fs.get.type[{#DEVNAME}]'
              value_type: TEXT
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.config.[?(@.name==''{#DEVNAME}'')].type.first()'
              master_item:
                key: 'vfs.dev.get[device_stats]'
            - name: '[{#DEVNAME}] [values] name'
              type: DEPENDENT
              key: 'vfs.fs.get.values.name[{#DEVNAME}]'
              value_type: TEXT
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.values.[?(@.name==''{#DEVNAME}'')].name.first()'
              master_item:
                key: 'vfs.dev.get[device_stats]'
          master_item:
            key: 'vfs.dev.get[device_stats]'
          lld_macro_paths:
            - lld_macro: '{#DEVNAME}'
              path: $.name
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.config
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
