Host Directory
Host directory collector is used to collect directory files, such as the number of files, all file sizes, etc.
Configuration¶
Go to the conf.d/samples directory under the DataKit installation directory, copy hostdir.conf.sample and name it hostdir.conf. Examples are as follows:
[[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"
Once configured, restart DataKit.
The collector can now be turned on by ConfigMap injection collector configuration.
Metric¶
For all of the following metric sets, 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.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 |