Project: Netdata (Observability and Analysis / Observability)
File: files_and_directories.md

<!--startmeta customediturl: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/filecheck/README.md" meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/filecheck/metadata.yaml" sidebar_label: "Files and directories" learn_status: "Published" learnrelpath: "Collecting Metrics/Linux Systems" most_popular: False message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE" endmeta--> <img src="https://netdata.cloud/img/filesystem.svg" width="150"/> Plugin: go.d.plugin Module: filecheck <img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" /> This collector monitors files and directories. This collector is supported on all platforms. This collector supports collecting metrics from multiple instances of this integration, including remote instances. This collector requires the DACREADSEARCH capability, but it is set automatically during installation, so no manual configuration is needed. This integration doesn't support auto-detection. The default configuration for this integration does not impose any limits on data collection. The default configuration for this integration is not expected to impose a significant performance impact on the system. Metrics grouped by scope. The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. These metrics refer to the File. Labels: | Label | Description | |:--|:-| | file_path | File absolute path | Metrics: | Metric | Dimensions | Unit | |:|:-|:-| | filecheck.fileexistencestatus | exist, not_exist | status | | filecheck.filemodificationtimeago | mtimeago | seconds | | filecheck.filesizebytes | size | bytes | These metrics refer to the Directory. Labels: | Label | Description | |:--|:-| | dir_path | Directory absolute path | Metrics: | Metric | Dimensions | Unit | |:|:-|:-| | filecheck.direxistencestatus | exist, not_exist | status | | filecheck.dirmodificationtimeago | mtimeago | seconds | | filecheck.dirsizebytes | size | bytes | | filecheck.dir_files count | files | files | There are no alerts configured by default for this integration. No action required. The configuration file name for this integration is `go.d/filecheck.conf`. You can edit the configuration file using the `edit-config` script from the Netdata . ```bash cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata sudo ./edit-config go.d/filecheck.conf ``` The following options can be defined globally: updateevery, autodetectionretry. <details><summary>Config options</summary> | Name | Description | Default | Required | |:-|:--|:-|:--:| | update_every | Data collection frequency. | 10 | no | | autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no | | files | List of files to monitor. | | yes | | dirs | List of directories to monitor. | | yes | | discovery_every | Files and directories discovery interval. | 60 | no | Files matching the selector will be monitored. Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) Pattern syntax: Syntax: ```yaml files: includes: pattern1 pattern2 excludes: pattern3 pattern4 ``` Directories matching the selector will be monitored. Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) Pattern syntax: Syntax: ```yaml dirs: includes: pattern1 pattern2 excludes: pattern3 pattern4 ``` </details> Files monitoring example configuration. <details><summary>Config</summary> ```yaml jobs: name: files_example files: include: '/path/to/file1' '/path/to/file2' '/path/to/*.log' ``` </details> Directories monitoring example configuration. <details><summary>Config</summary> ```yaml jobs: name: files_example dirs: collectdirsize: no include: '/path/to/dir1' '/path/to/dir2' '/path/to/dir3*' ``` </details> To troubleshoot issues with the `filecheck` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`. ```bash cd /usr/libexec/netdata/plugins.d/ ``` Switch to the `netdata` user. ```bash sudo -u netdata -s ``` Run the `go.d.plugin` to debug the collector: ```bash ./go.d.plugin -d -m filecheck ```