[Check_mk (english)] windows - check if a folder is empty

Hi Jam,

That’s what I documented a while ago. Feel free to send me your comments.

Filesystem Checks

File Count

To monitor the count of files in a directory do the following:

Select “Parameters for discovered Services” in “Host and Service Parameters” then “** File
Grouping Patterns**” in “Storage, File system and Files”. Select the folder from the pull down menu at the bottom and then select “Create Rule in Folder”. In the pane “Value” give the Group a meaningful unique name and file the “** Include
Pattern**” or even “Exclude Pattern” field.
Patterns with * or ? like

···

d:\spool*

could be used.

Furthermore, the current time/date in a configurable format may be included in the pattern. The syntax
is as follows: $DATE:format-spec$, where format-spec is a list of time format directives of the unix date command.
Example: $DATE:%Y%m%d$ is todays date, e.g. 20140127. A pattern of /var/tmp/backups/$DATE:%Y%m%d$.txt would search for .txt files with todays date as name in the directory /var/tmp/backups. Select Save at the bottom of the page to save the Group.

Select “Manual Checks” then “Size, age and count of file groups ” in WATO. Choose a folder from the pull down
menu at the bottom of the page and select “Create Rule in Folder”.
In the “Parameters” pane type the former created Groupname in the field “**File Group Name” and select the options of the parameters.

From: checkmk-en-bounces@lists.mathias-kettner.de [mailto:checkmk-en-bounces@lists.mathias-kettner.de]
On Behalf Of Jam Mulch
Sent: Montag, 17. Oktober 2016 14:46
To: Kammerer, Nils; ‘checkmk-en@lists.mathias-kettner.de’
Subject: Re: [Check_mk (english)] windows - check if a folder is empty

https://mathias-kettner.de/checkmk_check_fileinfo.groups.html

On 10/17/2016 8:27 AM, Kammerer, Nils wrote:

Hi all,

is it possible to check if a folder is empty with check_mk?

Something like, if a folder contains one file there will be a WARN, if it contains two files there will be a CRIT message.

Best Regards Nils

_______________________________________________
checkmk-en mailing list
checkmk-en@lists.mathias-kettner.de
[http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en](http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en)