Monitoring files on a host can be an instrumental part of application monitoring. Here we will describe some use cases and how to configure them. |
With Checkmk, you can monitor single files for pure existence, their age, size, etc. But it is also sometimes necessary to group several files into one service and impose those rules and thresholds on such a filegroup.
First, we must tell the agent which files should be monitored. This can be done with the Checkmk agent bakery in Checkmk Enterprise, Enterprise Free, and managed service edition. In Checkmk RAW Edition, this needs to be done manually.
Paths and files are case-sensitive, even in the Windows agent. |
In the file C:\ProgramData\checkmk\agent\check_mk.user.yml, create a fileinfo section like this:
fileinfo: enabled: true path: - c:\temp\*.txt - c:\path\to\file.dat |
.
For example, this is with a threshold for the maximum age.
Sometimes it is desired not to monitor the individual files but a file group instead. To do this, you need to create a rule on the type "File Grouping Patterns" There, you have to specify a name for the group, "Include Patterns," and optionally "Exclude Patterns."
Example
Sometimes you have a special use case where the single files or files that are part of file groups do not exist (during discovery). E.g., you want to monitor the quarantine directory of antivirus software, which should normally be empty.
As the Checkmk Discovery can only discover things that exist during the discovery process, we have a logical problem.
To circumvent this issue, you have to create the "Size and age of single files" and "Size, age, and count of file groups" rules from above not in the "Discovery rule" section of the setup menu but in the "Enforced services" part of the setup.
The rules can be found here:
By creating such an enforced rule, you can force Checkmk to create a service check, and you can monitor files that are not present during discovery.
Related articles appear here based on the labels you select. Click to edit the macro and add or change labels.
|