Page 1 of 1

Monitor folder modified data

Posted: Sun Mar 04, 2018 5:15 am
by McHenry
I have a series of folders that I need to monitor. These folders have files downloaded to them periodically and I need to know if now files have been downloaded in the last day.

The downloaded files are cleared out hourly.

Is there a way of using check_files to monitor the folder modification date/time?

My folders are:

D:\Downloads\a
D:\Downloads\b
D:\Downloads\c
D:\Downloads\d
D:\Downloads\e

I have found a command to check the file modified date however I am unsure of how to convert this to folder modified date:
./check_nrpe -H 10.25.11.3 -c check_files -a path=’E:\\ServerFolders\\NoBackup\\Junk’ pattern=*.* ’filter= written > -2h’ ’crit= count < 1’ ’empty-state=critical’ ’empty-syntax=${status}: No files found’

https://support.nagios.com/kb/article/f ... e_modified

Re: Monitor folder modified data

Posted: Mon Mar 05, 2018 4:30 pm
by npolovenko
Hello, @McHenry. Are the folders static or they're being created on daily basis? If the folders are static you could run a similar query for each one:

Code: Select all

./check_nrpe -H 192.168.3.239 -c check_files -a path=d:/downloads/a/ 'crit=age<86400'