Page 1 of 1
File aging monitoring on windows
Posted: Wed Mar 31, 2021 3:25 am
by deek
Hello ,
I want to monitor a particular file ( acs2dms.dat ) and alert when the file sits for more than 15 mins .
I have used below command to fetch the data but its looking into all the folders for that particular file and alerting . I would like to search only for that particular file ( acs2dms.dat ) on that path ( D:\Intelligrated\FTP\shipping ) . Im not sure if the query which i have used is correct .
[nagios@xyz ~]$ /usr/local/nagios/libexec/check_nrpe -H msa***** -u -t 100 -c check_files -a path='D:\Intelligrated\FTP\shipping' pattern=acs2dms.dat 'filter=written < -15m' 'crit= count > 0' 'empty-state=ok' 'empty-syntax=${status}: No files found' 'top-syntax=${status}: ${count} files found'
OK: No files found|'count'=0;0;0
Capture_ctrl.PNG
Also let me know if there is any other plugin which can be used for this .
Re: File aging monitoring on windows
Posted: Wed Mar 31, 2021 2:29 pm
by vtrac
Hi,
I tested by creating a new file called "VTest.txt" under "C:/Vinh" folder.
When a file is
less than "15m", or just created:
Code: Select all
[root@VT-NagiosXI-62 nagios]# /usr/local/nagios/libexec/check_nrpe -2 -H 192.168.x.x -u -t 100 -c check_files -a path='c:/Vinh' pattern=VTest.txt 'filter=written < -15m' 'crit= count > 0' 'empty-state=ok' 'empty-syntax=${status}: No files found' 'top-syntax=${status}: ${count} files found: ${problem_list}'
I got:
When a its
passed "15m", I got:
Code: Select all
[root@VT-NagiosXI-62 nagios]# /usr/local/nagios/libexec/check_nrpe -2 -H 192.168.x.x -u -t 100 -c check_files -a path='c:/Vinh' pattern=VTest.txt 'filter=written < -15m' 'crit= count > 0' 'empty-state=ok' 'empty-syntax=${status}: No files found' 'top-syntax=${status}: ${count} files found: ${problem_list}'
Here's the output:
Code: Select all
CRITICAL: 1 files found: VTest.txt|'count'=1;0;0
What version of NSClient++ are you using?
I used
NSClient++ v0.5.2035.
Try to upgrade to the latest NSClient++, if your did not work.
Regards,
Vinh
Re: File aging monitoring on windows
Posted: Thu Apr 01, 2021 2:10 am
by deek
Thanks for that .
But when i tried for dms2acs.dat file under the path D:\Intelligrated\FTP\shipping . Its giving a critical error but that file wasnt present when I tried the testing . The query is actually searching for dms2acs.dat file in each and every folder , I have pasted the screenshot for reference .
Capture_ctrl 2.PNG
Capture_ctrl 3.PNG
Re: File aging monitoring on windows
Posted: Thu Apr 01, 2021 11:40 am
by vtrac
Hi,
It seems to works for me when I searched for "VTest.txt" file.
Not sure if you notice it, but I add "${problem_list}" to the end of the command.
This will display the name of the file when found CRITICAL (please see my command from last replied).
[root@VT-NagiosXI-62 nagios]# /usr/local/nagios/libexec/check_nrpe -2 -H 192.168.x.x -u -t 100 -c check_files -a path='c:/Vinh' pattern=VTest.txt 'filter=written < -15m' 'crit= count > 0' 'empty-state=ok' 'empty-syntax=${status}: No files found' 'top-syntax=${status}: ${count} files found: ${problem_list}'
Here's the output:
CRITICAL: 1 files found: VTest.txt|'count'=1;0;0
Also, what version of your NSClient++?
Could you please upgrade that to the latest? .... which I did.
Regards,
Vinh
Re: File aging monitoring on windows
Posted: Wed Apr 07, 2021 1:12 am
by deek
Hello ,
Version: 3.2.1 - This is the version
And I wanted to tell that it worked for me. I have used the query as below . I didnt give file name in the pattern and mentioned it in the path .
check_files -a path='D:\Intelligrated\FTP\shipping\ACS2DMS.dat' pattern='' 'filter=written < -15m' 'crit= count > 0' 'empty-state=ok' 'empty-syntax=${status}: No files found' 'top-syntax=${status}: ${count} files found: ${problem_list}'
Thank you so much for your help
You can close the ticket .
Re: File aging monitoring on windows
Posted: Wed Apr 07, 2021 7:14 am
by scottwilkerson
deek wrote:Hello ,
Version: 3.2.1 - This is the version
And I wanted to tell that it worked for me. I have used the query as below . I didnt give file name in the pattern and mentioned it in the path .
check_files -a path='D:\Intelligrated\FTP\shipping\ACS2DMS.dat' pattern='' 'filter=written < -15m' 'crit= count > 0' 'empty-state=ok' 'empty-syntax=${status}: No files found' 'top-syntax=${status}: ${count} files found: ${problem_list}'
Thank you so much for your help
You can close the ticket .
Locking thread