# Custom File Check for Datadog Agents

> A custom Datadog check that monitors file existence and captures file age metrics.

- Canonical URL: https://webofmike.com/custom-file-check-for-datadog-agents/
- Author: Mike Moore (https://webofmike.com/about/)
- Published: 2019-01-04
- Last modified: 2019-01-04
- Tags: Datadog, Monitoring
- Cite as: Mike Moore, "Custom File Check for Datadog Agents", Web of Mike (webofmike.com), 2019-01-04. https://webofmike.com/custom-file-check-for-datadog-agents/


One of the most valuable aspects of the Datadog agent is its extensibility. Although the platform provides numerous out-of-the-box integrations, edge cases frequently emerge that demand custom solutions.

This article presents a straightforward custom check that monitors file existence. When a target file is found, the check reports success; if absent, it logs an error tagged with the filename. Additionally, the solution captures `file.age` and `file.modified` metrics when files exist, both tagged by filename for easy identification and aging tracking.

The implementation is available in the author's GitHub repository at the file-check directory.

