文件目录
主机目录采集器用于目录文件的采集,例如文件个数、所有文件大小等。
配置¶
进入 DataKit 安装目录下的 conf.d/host
目录,复制 hostdir.conf.sample
并命名为 hostdir.conf
。示例如下:
[[inputs.hostdir]]
interval = "10s"
# directory to collect
# Windows example: C:\\Users
# UNIX-like example: /usr/local/
dir = "" # required
# optional, i.e., "*.exe", "*.so"
exclude_patterns = []
[inputs.hostdir.tags]
# some_tag = "some_value"
# more_tag = "some_other_value"
配置好后,重启 DataKit 即可。
目前可以通过 ConfigMap 方式注入采集器配置来开启采集器。
指标¶
以下所有指标集,默认会追加名为 host
的全局 tag(tag 值为 DataKit 所在主机名),也可以在配置中通过 [inputs.hostdir.tags]
指定其它标签:
hostdir
¶
- 标签
Tag | Description |
---|---|
file_ownership | File ownership. |
file_system | File system type. |
host_directory | The start Dir. |
mount_point | Mount point. |
- 指标列表
Metric | Description |
---|---|
dir_count | The number of Dir. Type: int Unit: count |
file_count | The number of files. Type: int Unit: count |
file_size | The size of files. Type: int Unit: digital,B |
free | Free disk size in bytes. Type: int Unit: digital,B |
inodes_free | Free inode. Type: int Unit: count |
inodes_total | Total inode. Type: int Unit: count |
inodes_used | Used inode(only this dir used). Type: int Unit: count |
inodes_used_percent | Inode used percent(only this dir used in total inode). Type: float Unit: percent,percent |
total | Total disk size in bytes. Type: int Unit: digital,B |
used_percent | Used disk size in percent(only this dir used in total size). Type: float Unit: percent,percent |