跳转至

Lsblk


lsblk 采集器用于 Linux 主机块设备信息采集,如设备名称、主次设备号、文件系统可用大小、文件系统类型、文件系统已用大小、文件系统使用百分比、设备挂载位置等。

配置

进入 DataKit 安装目录下的 conf.d/samples 目录,复制 lsblk.conf.sample 并命名为 lsblk.conf。示例如下:

[[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"

配置好后,重启 DataKit 即可。

可通过 ConfigMap 方式注入采集器配置配置 ENV_DATAKIT_INPUTS 开启采集器。

也支持以环境变量的方式修改配置参数(需要在 ENV_DEFAULT_ENABLED_INPUTS 中加为默认采集器):

  • ENV_INPUT_LSBLK_INTERVAL

    采集器重复间隔时长

    字段类型: Duration

    采集器配置字段: interval

    默认值: 10s

  • ENV_INPUT_LSBLK_EXCLUDE_DEVICE

    排除的设备前缀。(默认收集以 dev 为前缀的所有设备)

    字段类型: List

    采集器配置字段: exclude_device

    示例: /dev/loop0,/dev/loop1

指标

以下所有数据采集,默认会追加名为 host 的全局 tag(tag 值为 DataKit 所在主机名),也可以在配置中通过 [inputs.lsblk.tags] 指定其它标签:

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

lsblk

Tags & Fields Description
group
(tag)
Group name.
is_mounted
(tag)
Whether the device has a mounted filesystem. Values are yes or no.
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_avail Available bytes on the mounted filesystem from statfs.Bavail * statfs.Bsize.
Type: float | (gauge)
Unit: digital,B
Tagged by: group, is_mounted, kname, label, maj_min, model, mountpoint, name, owner, parent, serial, state, type, uuid, vendor
fs_size Total bytes on the mounted filesystem from statfs.Blocks * statfs.Bsize.
Type: float | (gauge)
Unit: digital,B
Tagged by: group, is_mounted, kname, label, maj_min, model, mountpoint, name, owner, parent, serial, state, type, uuid, vendor
fs_used Used bytes on the mounted filesystem from (statfs.Blocks - statfs.Bfree) * statfs.Bsize.
Type: float | (gauge)
Unit: digital,B
Tagged by: group, is_mounted, kname, label, maj_min, model, mountpoint, name, owner, parent, serial, state, type, uuid, vendor
fs_used_percent Used filesystem capacity percentage, calculated as fs_used / fs_size * 100.
Type: float | (gauge)
Unit: percent,percent
Tagged by: group, is_mounted, kname, label, maj_min, model, mountpoint, name, owner, parent, serial, state, type, uuid, vendor
rq_size Maximum number of I/O requests allowed in the block device request queue from /sys/.../queue/nr_requests.
Type: float | (gauge)
Unit: count
Tagged by: group, is_mounted, kname, label, maj_min, model, name, owner, parent, serial, state, type, uuid, vendor
size Block device size in bytes, calculated from the /sys sector count multiplied by 512.
Type: float | (gauge)
Unit: digital,B
Tagged by: group, is_mounted, kname, label, maj_min, model, name, owner, parent, serial, state, type, uuid, vendor

文档评价

文档内容是否对您有帮助? ×