File aging monitoring on windows

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
deek
Posts: 194
Joined: Fri Apr 26, 2019 2:01 am

File aging monitoring on windows

Post 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 .
You do not have the required permissions to view the files attached to this post.
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: File aging monitoring on windows

Post 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:

Code: Select all

OK: No files found|'count'=0;0;0
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
deek
Posts: 194
Joined: Fri Apr 26, 2019 2:01 am

Re: File aging monitoring on windows

Post 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
You do not have the required permissions to view the files attached to this post.
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: File aging monitoring on windows

Post 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
deek
Posts: 194
Joined: Fri Apr 26, 2019 2:01 am

Re: File aging monitoring on windows

Post 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 .
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: File aging monitoring on windows

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked