Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Info
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.

Status
colourGreen
titleLAST TESTED ON CHECKMK 2.3.0P1


Panel
borderColorblack
bgColor#f8f8f8
titleTable of Contents

Table of Contents


With Checkmk, you can monitor single files for pure existence, their age and , 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.

...

Configuration of the agent

In the first stepFirst, we need to 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.

...

With agent bakery (Enterprise editions):

  1. To create a new rule, go to Setup → Agents → Windows, Linux, Solaris, AIX → Agent rules → Count, size, and age of files and specify which files to be included:
    Screenshot new rule to count the size and age of filesImage Modified

    Take a look at the inline help for possible patterns.

  2. Bake & Sign the agents to deploy the new agent configuration.

...

Without agent bakery (RAW edition):

Note

Paths and files are case-sensitive, even in the Windows agent.


  1. In the file C:\ProgramData\checkmk\agent\check_mk.user.yml, create a fileinfo section like this:

    Code Block
    languagepowershell
    themeRDark
    fileinfo:

...

  1. 
    enabled: true

...

  1. 
    path:

...

  1. 
    - c:\temp\*.txt

...

  1. 
    - c:\path\to\file.dat

and restart the Checkmk agent.

Info

Please be aware that paths and files are case-sensitive, even in the Windows agent.

...

  1. .

  2. Restart the Checkmk agent

Monitoring of single files

...

  1. Rediscover your host, and you will find the single files that you configured in

...

  1. Step 1, and you can add them to monitoring:

...

  1. Screenshot displaying four files in a status of OKImage Added

    After that, you can create rules to specify how to monitor those files.

...

  1. .
  2. Click on the "hamburger" menu of that service

...

  1. , then "Parameters for this service."
    Screenshot showing where the parameters for this services is locatedImage Added

...

  1. .

...

  1. Click "Size and age of single files" to create a rule

...


...

  1. Screenshot detailing the location of size and age of single files option.Image Added

...


For example

...

, this is with a threshold for the maximum age.

...

Screenshot showing the maximal age thresholdsImage Added

...

Monitoring of file groups

Sometimes it is desired not to monitor the individual files but a file group instead. To do this, you need to create a rule oh on the type "File Grouping Patterns"

(Setup → Services → Service monitoring rules → File Grouping Patterns)

There There, you have to specify a name for the group, "Include Patterns," and optionally "Exclude Patterns."

Image Removed

...


  1. Go to Setup → Services → Service monitoring rules → Grouping Patterns → Add rule
    Screenshot detailing file grouping patternsImage Added
    .
  2. After a Re-Discovery, the single file services will vanish, and the file group will appear

...

Image Removed

  1. , and you can add the new service to the monitoring
    Screenshot showing all four files as vanished and a new group service is available.Image Added
    .

...

  1. Create a rule by clicking on the "hamburger menu" / Parameters for this service

Image Removed

...

  1. Screenshot showing where the parameters for this services is locatedImage Added
    .
  2. Click "Size, age, and count of file groups" to create a rule as desired

...


Image Removed

for example like this:

Image Removed

...

  1. Screenshot detailing the location of size and age of single files option.Image Added


Example

Screenshot showing the maximal age thresholdsImage Added

Special case: file(s) does not exist during discovery

Sometimes you have the 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 an antivirus software, which should normally be normally empty.

As the Checkmk Discovery can only discover things that exist during the discovery process, we have a logical problem here.

To circumvent this issue, you have to create the "rules from above. These rules are called Size and age of single files and " Size, age, and count of file groups " rules from above and are not in the " Discovery rule " section of the setup menu , but in the " Enforced services " part of the setup. So the

The rules can be found here:

  • Setup → Services → Enforced services → Size and age of single files
  • Setup → Services → Enforced services → Size, age, and count of file groups

By creating such an enforced rule, you can force Checkmk to create a service check, and you are able to can monitor files which that are not present during discovery.

Filter by label (Content by label)
showLabelsfalse
max5
spacesKB
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel in ( "filegroupkb-how-to-article" , "fileinfohowto" ) and type = "page" and space = "KB"
labelsfileinfo filegroupkb-how-to-article

Page Properties
hiddentrue


Related issues


...