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

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

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

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)

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.

I have only begun to work with check_mk, but it seems like the path should only include directory structure, and not include actual file info. Have you tried it without specifying .?

···

On Mon, Oct 17, 2016 at 7:45 AM, Kammerer, Nils N.Kammerer@mvb-online.de wrote:

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.


checkmk-en mailing list

checkmk-en@lists.mathias-kettner.de

http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en

Without wildcards in the check_mk.ini there are no file information.

Witht the wildcards I can see all information but the state is always “OK”.

···

I have only begun to work with check_mk, but it seems like the path should only include directory structure, and not include actual file info. Have you tried it without specifying .?

On Mon, Oct 17, 2016 at 7:45 AM, Kammerer, Nils N.Kammerer@mvb-online.de wrote:

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.


checkmk-en mailing list
checkmk-en@lists.mathias-kettner.de
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en

I set up a test folder on my windows workstation and it works fine
for me.
OK for 0 files, WARNING for 1 file, CRITICAL for 2 files.
If you describe exactly what you did, we might be able to spot the
problem.

···

On 10/17/2016 08:52 AM, FRANK Michael
wrote:

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:

            []

Jam Mulch
Montag, 17. Oktober 2016 14:46
Kammerer, Nils;
‘’
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.

checkmk-en-bounces@lists.mathias-kettner.demailto:checkmk-en-bounces@lists.mathias-kettner.deOn Behalf Of
Sent:
**To:**checkmk-en@lists.mathias-kettner.de
Subject:

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.

Hi Frank,

Hi Jam,

here is my configuration and my output.

Check_mk.ini

[fileinfo]

path = C:\Programs\Foo*.log

path = M:\Bar Test*.*

path = E:\MBF\payment\prod*.*

File Grouping Patterns

Name

Payment Prod

Include Pattern

E:\MBF\payment\prod*

Size, age and count of file groups

Name

Payment Prod

Maximal file count

Warning above 0

Critical above 1

Agent and Plugin output with no files in E:\MBF\payment\prod:

-d

E:\MBF\payment\prod*.*|missing|1476951689.046000

-v

File group Payment Prod 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 E:\MBF\payment\prod:

-d

E:\MBF\payment\prod\export_payment_20161019_201515.csv|20803|1476900005

-v

File group Payment Prod OK - age_oldest is 14 hours, age_newest is 14 hours, count is 1, size is 20803 B, size_smallest is 20803 B, size_largest
is 20803 B

Agent and Plugin output with two files in E:\MBF\payment\prod:

-d

E:\MBF\payment\prod\export_payment_20161019_201515 - Copy.csv|20803|1476900005

E:\MBF\payment\prod\export_payment_20161019_201515.csv|20803|1476900005

-v

File group Payment Prod OK - age_oldest is 14 hours, age_newest is 14 hours, count is 2, size is 41606 B, size_smallest
is 20803 B, size_largest is 20803 B

Our Check_MK and Agent Version is 1.2.8p12.

Any ideas why it does not work?

Do you need more information?

Best regards.

Nils

···

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

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.

Hi Nils,

Did you first have the service without threshold rule? After configuring the rule you have to rediscover the affected host, either by “cmk -IIv HOSTNAME” or TabulaRasa in WATO. Did you do that?

Regards,
Marcel

···

Kammerer, Nils N.Kammerer@mvb-online.de schrieb am Do., 20. Okt. 2016 10:46:

Hi Frank,

Hi Jam,

here is my configuration and my output.

Check_mk.ini

[fileinfo]

path = C:\Programs\Foo*.log

path = M:\Bar Test*.*

path = E:\MBF\payment\prod*.*

File Grouping Patterns

Name

        Payment Prod

Include Pattern

        E:\MBF\payment\prod\*

Size, age and count of file groups

        Name
                    Payment Prod
        Maximal file count
                    Warning above 0
                    Critical above 1

Agent and Plugin output with no files in E:\MBF\payment\prod:

-d

E:\MBF\payment\prod*.*|missing|1476951689.046000

-v

File group Payment Prod 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 E:\MBF\payment\prod:

-d

E:\MBF\payment\prod\export_payment_20161019_201515.csv|20803|1476900005

-v

File group Payment Prod OK - age_oldest is 14 hours, age_newest is 14 hours, count is 1, size is 20803 B, size_smallest is 20803 B, size_largest
is 20803 B

Agent and Plugin output with two files in E:\MBF\payment\prod:

-d

E:\MBF\payment\prod\export_payment_20161019_201515 - Copy.csv|20803|1476900005

E:\MBF\payment\prod\export_payment_20161019_201515.csv|20803|1476900005

-v

File group Payment Prod OK - age_oldest is 14 hours, age_newest is 14 hours, count is 2, size is 41606 B, size_smallest
is 20803 B, size_largest is 20803 B

Our Check_MK and Agent Version is 1.2.8p12.

Any ideas why it does not work?

Do you need more information?

Best regards.

Nils

Von: FRANK Michael [mailto:michael.frank@faurecia.com]
Gesendet: Montag, 17. Oktober 2016 19:33
An: Kammerer, Nils; Jam Mulch; ‘checkmk-en@lists.mathias-kettner.de’

Betreff: RE: [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.

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.


checkmk-en mailing list

checkmk-en@lists.mathias-kettner.de

http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en