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

Hi Nils,

I tested successful with the following configuration:

check_mk.ini

[fileinfo]

path = D:\spool*.*

File Grouping

Include Pattern

D:\spool*

Maximal file Count

Warning above 0

Critical above 1

Agent and Plugin output with no files in d:\spool:

cmk –d

D:\spool*.*|missing|1476724803.222000

cmk –v

File group Spool OK - age_oldest is 0 sec, age_newest is 0 sec, count is 0, size is 0 B

Agent and Plugin output with one file in d:\spool:

cmk –d

D:\spool\New Text Document.txt|0|1476725293

cmk –v

File group Spool WARN - age_oldest is 49 sec, age_newest is 49 sec, count is 1 (> 0)(!), size is 0 B, size_smallest is 0 B

Agent and Plugin output with two files in d:\spool:

cmk –d

D:\spool\New Rich Text Document.rtf|7|1476725397

D:\spool\New Text Document.txt|0|1476725293

cmk –v

File group Spool CRIT - age_oldest is 131 sec, age_newest is 27 sec, count is 2 (> 1)(!!), size is 7 B, size_smallest is 0 B, size_largest is 7 B

Regards

Michael

···

From: Kammerer, Nils [mailto:N.Kammerer@mvb-online.de]
Sent: Montag, 17. Oktober 2016 15:46
To: FRANK Michael; Jam Mulch; ‘checkmk-en@lists.mathias-kettner.de’
Subject: AW: [Check_mk (english)] windows - check if a folder is empty

Hi Frank,

nice documentation.

But i do not get any messages.

I tried “Maximal age of newest file” with a warning older than 1 mins but it still shows “ok” with “age_newest is 19 hours”.

Then I tried “Maximal file count” warning and critical above 0 but it stills shows “ok” with “count is 48”.

In the check_mk.ini I set "path = E:\prod*.* and my file group pattern is “E:\prod*”

Any ideas about that?

Best Regards.

Nils

Von: FRANK Michael [mailto:michael.frank@faurecia.com]
Gesendet: Montag, 17. Oktober 2016 14:52
An: Jam Mulch; Kammerer, Nils; ‘checkmk-en@lists.mathias-kettner.de’
Betreff: RE: [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)

This electronic transmission (and any attachments thereto) is intended solely for the use of the addressee(s). It may contain confidential or legally
privileged information. If you are not the intended recipient of this message, you must delete it immediately and notify the sender. Any unauthorized use or disclosure of this message is strictly prohibited. Faurecia does not guarantee the integrity of this
transmission and shall therefore never be liable if the message is altered or falsified nor for any virus, interception or damage to your system.