Zabbix Documentation 4.4

3.04.04.24.4 (current)| In development:5.0 (devel)| Unsupported:1.82.02.22.43.23.4Guidelines

User Tools

Site Tools


Sidebar

manual:discovery:low_level_discovery:devices

10 Discovery of block devices

In a similar way as file systems are discovered, it is possible to also discover block devices and their type.

Item key

The item key to use in the discovery rule is

vfs.dev.discovery

This item is supported on Linux platforms only, since Zabbix agent 4.4.

You may create discovery rules using this discovery item and:

  • filter: {#DEVNAME} matches sd[\D]$ - to discover devices named "sd0", "sd1", "sd2", …
  • filter: {#DEVTYPE} matches disk AND {#DEVNAME} does not match ^loop.* - to discover disk type devices whose name does not start with "loop"

Supported macros

This discovery key returns two macros - {#DEVNAME} and {#DEVTYPE} identifying the block device name and type respectively, e.g.:

[ 
   { 
      "{#DEVNAME}":"loop1",
      "{#DEVTYPE}":"disk"
   },
   { 
      "{#DEVNAME}":"dm-0",
      "{#DEVTYPE}":"disk"
   },
   { 
      "{#DEVNAME}":"sda",
      "{#DEVTYPE}":"disk"
   },
   { 
      "{#DEVNAME}":"sda1",
      "{#DEVTYPE}":"partition"
   }
]

Block device discovery allows to use vfs.dev.read[] and vfs.dev.write[] items to create item prototypes using the {#DEVNAME} macro, for example:

  • "vfs.dev.read[{#DEVNAME},sps]"
  • "vfs.dev.write[{#DEVNAME},sps]"

{#DEVTYPE} is intended for device filtering.