On this page
14 Ontdekking van blokapparaten
Op een vergelijkbare manier als bestandssystemen worden ontdekt, is het ook mogelijk om blokapparaten en hun type te ontdekken.
Item key
The item key to use in the discovery rule is
vfs.dev.discovery
This item is supported on Linux platforms only.
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
diskAND {#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.