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
Also let me know if there is any other plugin which can be used for this .
File aging monitoring on windows
File aging monitoring on windows
You do not have the required permissions to view the files attached to this post.
Re: File aging monitoring on windows
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:
I got:
When a its passed "15m", I got:
Here's the output:
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
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}'
Code: Select all
OK: No files found|'count'=0;0;0
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}'
Code: Select all
CRITICAL: 1 files found: VTest.txt|'count'=1;0;0
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
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 .
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 .
You do not have the required permissions to view the files attached to this post.
Re: File aging monitoring on windows
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
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
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 .
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 .
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: File aging monitoring on windows
Locking threaddeek 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 .