Skip to content

Lsblk


Lsblk collector is used for Linux host block device information collection, such as device name, primary and secondary device number, filesystem available size, filesystem type, filesystem used size, filesystem usage percentage, device mount location, etc.

Configuration

Collector Configuration

Go to the conf.d/host directory under the DataKit installation directory, copy lsblk.conf.sample and name it lsblk.conf. Examples are as follows:

[[inputs.lsblk]]
  ##(optional) collect interval, default is 10 seconds
  interval = '10s'
  # exclude_device = ['/dev/sda1','/dev/sda2']

[inputs.lsblk.tags]
  # some_tag = "some_value"
  # more_tag = "some_other_value"

Once configured, restart DataKit.

Can be turned on by ConfigMap Injection Collector Configuration or Config ENV_DATAKIT_INPUTS .

Can also be turned on by environment variables, (needs to be added as the default collector in ENV_DEFAULT_ENABLED_INPUTS):

  • ENV_INPUT_LSBLK_INTERVAL

    Collect interval

    Type: Duration

    input.conf: interval

    Default: 10s

  • ENV_INPUT_LSBLK_EXCLUDE_DEVICE

    Excluded device prefix. (By default, collect all devices with dev as the prefix)

    Type: List

    input.conf: exclude_device

    Example: /dev/loop0,/dev/loop1

Metric

For all of the following data collections, a global tag named host is appended by default (the tag value is the host name of the DataKit), or other tags can be specified in the configuration by [inputs.lsblk.tags]:

 [inputs.lsblk.tags]
  # some_tag = "some_value"
  # more_tag = "some_other_value"
  # ...

lsblk

Tags & Fields Description
fstype
(tag)
Filesystem type.
group
(tag)
Group name.
kname
(tag)
Internal kernel device name.
label
(tag)
Filesystem LABEL.
maj_min
(tag)
Major:Minor device number.
model
(tag)
Device identifier.
mountpoint
(tag)
Where the device is mounted.
name
(tag)
Device name.
owner
(tag)
User name.
parent
(tag)
Parent device name.
serial
(tag)
Disk serial number.
state
(tag)
State of the device.
type
(tag)
Device type.
uuid
(tag)
Filesystem UUID.
vendor
(tag)
Device vendor.
fs_used_percent Percentage of used space on the filesystem.
Type: float
Unit: percent,percent
fsavail Available space on the filesystem.
Type: int
Unit: digital,B
fssize Total size of the filesystem.
Type: int
Unit: digital,B
fsused Used space on the filesystem.
Type: int
Unit: digital,B
rq_size Request queue size.
Type: int
Unit: digital,B
size Size of the device.
Type: int
Unit: digital,B