Check recursively if files (with defined extension) of last two days existing

Hi guys,

is there a way to recursively check a folder, if files with defined extension of the last two days existing?

Icinga2 master is on Debian. And the files, that needs to be checked are on a windows server.

Cheers

Please put this into context. Do you need this within icinga 2? Is this a check you want to write?

What kind of OS? Windows? Linux?

Icinga2 master is on Debian. And the files, that needs to be checked are on a windows server.

So this is about creating a check plugin. This answer has everything you need for windows, you can adapt it to filter for the extension you require and just have to construct the return value/output based on your needs :slight_smile:

1 Like

Hi,

i have a Powershellscript that I use to do this. Its still under development, but you can try it and give some feedback if You want.

It can check for count, age and size of single files with wildcard(not tested very well) or recursive folders.

The script still need more testing/optimizing, but I use it on around 10 Checks already.

check_files.ps1.txt (9.8 KB)