Hi Team,
We have a new requirement as described below:
Need to introduce monitoring to specified directories. The monitoring should run on the days and should send an alert to the required email addresses if the threshold level stated (total number of files) is less than that outlined below.
\\server.domain\SAPSHR05\DATA\PROD\Import
--> RULE: Less than 50 files with 'Date modified' equal to previous day
\\server.domain\SAPSHR05\DATA\PROD\Export
--> RULE: Less than 5 files with 'Date modified' equal to previous day
Timing of monitoring:
Once daily between (7am and 9am UK time) Tuesday to Saturday
Please guide us how can we achieve this in Nagios with detailed steps.
Thanks in Advance!!!
File Monitoring
Re: File Monitoring
You can try these:
- NOTE: X.X.X.X is a Windows system running NSClient++:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
--> RULE: Less than 50 files with 'Date modified' equal to previous day
--> RULE: Less than 5 files with 'Date modified' equal to previous day
Modified from here:
https://support.nagios.com/kb/article/f ... l#advanced
And here:
https://docs.nsclient.org/reference/win ... les_filter
Then you would create a timeperiod when the checks should occur in Configure > Core Config Manager > Time Periods:
https://assets.nagios.com/downloads/nag ... riods.html
Then edit the service and under the Check Settings tab, select the new timeperiod from as the Check Period. Save and Apply Configuration.
See here as well if you have questions:
https://assets.nagios.com/downloads/nag ... gement.pdf
- NOTE: X.X.X.X is a Windows system running NSClient++:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
--> RULE: Less than 50 files with 'Date modified' equal to previous day
Code: Select all
/usr/local/nagios/libexec/check_nrpe -2 -H X.X.X.X -c check_files -a path='
\\server.domain\SAPSHR05\DATA\PROD\Import' pattern=*.* 'filter=written < -24h' 'crit=count < 50' 'empty-state=critical' 'empty-syntax=${status}: No files found'Code: Select all
/usr/local/nagios/libexec/check_nrpe -2 -H X.X.X.X -c check_files -a path='
\\server.domain\SAPSHR05\DATA\PROD\Export' pattern=*.* 'filter=written < -24h' 'crit=count < 5' 'empty-state=critical' 'empty-syntax=${status}: No files found'https://support.nagios.com/kb/article/f ... l#advanced
And here:
https://docs.nsclient.org/reference/win ... les_filter
Then you would create a timeperiod when the checks should occur in Configure > Core Config Manager > Time Periods:
https://assets.nagios.com/downloads/nag ... riods.html
Then edit the service and under the Check Settings tab, select the new timeperiod from as the Check Period. Save and Apply Configuration.
See here as well if you have questions:
https://assets.nagios.com/downloads/nag ... gement.pdf