File Age is not working as expected for Windows machine.

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: File Age is not working as expected for Windows machine.

Post by tgriep »

I suggest upgrading the NSClient++ agent to the latest 0.5.2 version in case there is a bug in it.

Also, you did not run my last example command. I did some slight changes to it that I wanted to see if they help.
Be sure to check out our Knowledgebase for helpful articles and solutions!
amane
Posts: 77
Joined: Thu Jan 18, 2018 9:53 am

Re: File Age is not working as expected for Windows machine.

Post by amane »

Please find the output below from your last example command :

[nagios@Nagiosserver ~]$ /usr/local/nagios/libexec/check_nrpe -H 10.128.160.116 -t 60 -c check_files -a path='F:\\RedPrairie\\LABOR\\LES\\files\\hostout\\import\\slms' pattern=slms.* 'filter=written < -5m' 'crit= count > 0' 'empty-state=ok' 'top-syntax=${status}: ${count} files found' 'empty-syntax=${status}: No files found'
OK: No files found|'count'=0;0;0


Now using this above i can see the output status is in OK state.

Can you please tell me exactly what slight changes you made? And we are good to made those changes In our nagios conf. file.

Thanks.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: File Age is not working as expected for Windows machine.

Post by tgriep »

The changes that I did was to add the slms folder to the path and I swapped the order for the empty-syntax and top-syntax filter because I found that the order of the filter may cause the output to change.
Be sure to check out our Knowledgebase for helpful articles and solutions!
amane
Posts: 77
Joined: Thu Jan 18, 2018 9:53 am

Re: File Age is not working as expected for Windows machine.

Post by amane »

Hello,

Is there any way to check only for the files starting with slms.* becuase I found on this path 'F:\\RedPrairie\\LABOR\\LES\\files\\hostout\\import'
there are sub-folders and the slms files are residing inside these sub-folders.

So here i want to check only for the files that are in /import folder and not the sub-folders 'F:\\RedPrairie\\LABOR\\LES\\files\\hostout\\import' which contains the slms.* file. And script which we are using checking for both the files and sub-folders and due to this count is showing 3 on Nagios with status CRITICAL.

Below is the command and i want to search for the files not the folders on this path 'F:\\RedPrairie\\LABOR\\LES\\files\\hostout\\import'

[nagios@Nagiosserver~]$ /usr/local/nagios/libexec/check_nrpe -H 10.128.160.116 -t 60 -c check_files -a path='F:\\RedPrairie\\LABOR\\LES\\files\\hostout\\import' pattern=slms.* 'filter=written < -5m' 'crit= count > 0' 'empty-state=ok' 'top-syntax=${status}: ${count} files found' 'empty-syntax=${status}: No files found'
CRITICAL: 3 files found|'count'=3;0;0

I am attaching the snip with this. I want to check only for the Files not the sub-folders.

Thanks...
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: File Age is not working as expected for Windows machine.

Post by tgriep »

By default, if you do not specify, the check_files command will check the folder and all subfolders for the pattern specified.
If you do not want that recurse in to subfolders, add this to the command.

Code: Select all

max-depth=1
max-depth Maximum depth to recurse
https://docs.nsclient.org/reference/win ... heck_files
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked