文件目录
主机目录采集器用于目录文件的采集,例如文件个数、所有文件大小等。
配置¶
进入 DataKit 安装目录下的 conf.d/samples 目录,复制 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¶
| Tags & Fields | Description |
|---|---|
| file_ownership ( tag) |
File ownership. |
| file_system ( tag) |
File system type. |
| host_directory ( tag) |
The start Dir. |
| mount_point ( tag) |
Mount point. |
| dir_count | The number of Dir. Type: int | (gauge) Unit: count |
| file_count | The number of files. Type: int | (gauge) Unit: count |
| file_size | The size of files. Type: int | (gauge) Unit: digital,B |
| free | Free disk size in bytes. Type: int | (gauge) Unit: digital,B |
| inodes_free | Free inode. Type: int | (gauge) Unit: count |
| inodes_total | Total inode. Type: int | (gauge) Unit: count |
| inodes_used | Used inode(only this dir used). Type: int | (gauge) Unit: count |
| inodes_used_percent | Inode used percent(only this dir used in total inode). Type: float | (gauge) Unit: percent,percent |
| total | Total disk size in bytes. Type: int | (gauge) Unit: digital,B |
| used_percent | Used disk size in percent(only this dir used in total size). Type: float | (gauge) Unit: percent,percent |