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
¶
- Tags
Tag | Description |
---|---|
file_ownership | File ownership. |
file_system | File system type. |
host_directory | The start Dir. |
mount_point | Mount point. |
- Metrics
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 |