zabbix_export:
  version: '7.4'
  host_groups:
    - uuid: 6f6799aa69e844b4b3918f779f2abf08
      name: 'Zabbix servers'
  hosts:
    - host: test
      name: test
      groups:
        - name: 'Zabbix servers'
      interfaces:
        - interface_ref: if1
      discovery_rules:
        - name: 'Mounted filesystem discovery'
          key: vfs.fs.discovery
          filter:
            evaltype: AND
            conditions:
              - macro: '{#FSNAME}'
                value: '{$VFS.FS.FSNAME.MATCHES}'
              - macro: '{#FSNAME}'
                value: '{$VFS.FS.FSNAME.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#FSTYPE}'
                value: '{$VFS.FS.FSTYPE.MATCHES}'
              - macro: '{#FSTYPE}'
                value: '{$VFS.FS.FSTYPE.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
          lifetime: 30d
          enabled_lifetime_type: DISABLE_NEVER
          description: 'The discovery of mounted filesystems with different types.'
          interface_ref: if1
          item_prototypes:
            - name: '{#FSNAME}: Used space'
              type: ZABBIX_ACTIVE
              key: 'vfs.fs.size[{#FSNAME},used]'
              history: 7d
              units: B
              description: 'Used storage in bytes'
              tags:
                - tag: component
                  value: storage
                - tag: filesystem
                  value: '{#FSNAME}'
          overrides:
            - name: 'Skip metadata collection for dynamic FS'
              step: '1'
              filter:
                conditions:
                  - macro: '{#FSTYPE}'
                    value: ^(btrfs|zfs)$
              operations:
                - operator: LIKE
                  value: inode
                  discover: DISCOVER
      macros:
        - macro: '{$VFS.FS.FSNAME.MATCHES}'
          value: .+
          description: 'This macro is used for discovery of the filesystems. It can be overridden on host level or its linked template level.'
        - macro: '{$VFS.FS.FSNAME.NOT_MATCHES}'
          value: ^(/dev|/sys|/run|/proc|.+/shm$)
          description: 'This macro is used for discovery of the filesystems. It can be overridden on host level or its linked template level.'
        - macro: '{$VFS.FS.FSTYPE.MATCHES}'
          value: ^(btrfs|ext2|ext3|ext4|reiser|xfs|ffs|ufs|jfs|jfs2|vxfs|hfs|apfs|refs|ntfs|fat32|zfs)$
          description: 'This macro is used for discovery of the filesystems. It can be overridden on host level or its linked template level.'
        - macro: '{$VFS.FS.FSTYPE.NOT_MATCHES}'
          value: ^\s$
          description: 'This macro is used for discovery of the filesystems. It can be overridden on host level or its linked template level.'
