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/host
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
¶
- tag
Tag | Description |
---|---|
file_ownership |
File ownership. |
file_system |
File system type. |
host_directory |
The start Dir. |
mount_point |
Mount point. |
- metric list
Metric | Description | Type | Unit |
---|---|---|---|
dir_count |
The number of Dir. | int | count |
file_count |
The number of files. | int | count |
file_size |
The size of files. | int | B |
free |
Free disk size in bytes. | int | B |
inodes_free |
Free inode. | int | count |
inodes_total |
Total inode. | int | count |
inodes_used |
Used inode(only this dir used). | int | count |
inodes_used_percent |
Inode used percent(only this dir used in total inode). | float | percent |
total |
Total disk size in bytes. | int | B |
used_percent |
Used disk size in percent(only this dir used in total size). | float | percent |