Re: Looking for a file check script
Posted: Wed Apr 01, 2015 8:34 am
Box293 wrote:I hate to distract from the great solutions already provided, however NSClient++ has this functionality built in, no need for extra scripts.
From my website http://sites.box293.com/nagios/guides/c ... es-folders
Make Sure Files Exists That Were Modified In The Last Two Hours
Check a folder to make sure files exist that were modified in the past two hours. Generate a critical alert if no files matching this criteria are found.
NSClient++ 0.3.9 & 0.4.1Note: If it is just a specific file you are after, I'm pretty sure you use path= and drop the pattern=Code: Select all
Command: check_nrpe -H 192.168.142.137 -c CheckFiles -a path='D:\\Important Stuff' pattern=*.* 'filter=written > -2h' 'master-syntax={%total% Files Found}' MinCrit=0 Output when files matching criteria are found: {1 Files Found}|'found files'=1;0;0 Output when NO files matching criteria are found: {0 Files Found}, found files: 0 < critical|'found files'=0;0;0Code: Select all
check_nrpe -H 192.168.142.137 -c CheckFiles -a path='D:\\Important Stuff\\Important File.txt' 'filter=written > -2h' 'master-syntax={%total% Files Found}' MinCrit=0
./check_nrpe -H 10.1.1.207 -c CheckFiles -a path='C:\\Sharepoint Reports\\running\\Reportrun.pdf' 'filter=written > -2h' 'master-syntax={%total% Files Found}' MinCrit=0
Exception processing request: Request command contained illegal metachars!