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] 指定其它标签:
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 | (gauge) Unit: percent,percent |
| fsavail | Available space on the filesystem. Type: int | (gauge) Unit: digital,B |
| fssize | Total size of the filesystem. Type: int | (gauge) Unit: digital,B |
| fsused | Used space on the filesystem. Type: int | (gauge) Unit: digital,B |
| rq_size | Request queue size. Type: int | (gauge) Unit: digital,B |
| size | Size of the device. Type: int | (gauge) Unit: digital,B |