check_winfile - age of file not working

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
marnix
Posts: 7
Joined: Wed Jul 20, 2016 8:44 am

check_winfile - age of file not working

Post by marnix »

hi
i want to filter some files in a folder. i want to get a crit when there are files older than 4 days
check_winfile is working - i got a check with filesize bigger than 3gb working fine

here is code:
check_winfile_age_odb_d = scripts\check_winfile.exe --target "D:\Savedb\" --filter "age ge 96 hours" --critical 0

Output while files are 1-10 days old:
FILE OK - 0 files out of 18 to consider
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: check_winfile - age of file not working

Post by mcapra »

Is there a particular reason you are using check_winfile as opposed to the built-in check_files command for NSClient++?

Code: Select all

[root@localhost libexec]# ./check_nrpe -H 192.168.67.99 -c check_files -a 'path=c:/users/admin/documents/files/' 'crit= age > 345600'
CRITICAL: 2/3 files (test.txt, test2.txt)|'test.txt_age'=3530479;0;345600 'test2.txt_age'=3530479;0;345600 'test3.txt_age'=857;0;345600
https://docs.nsclient.org/reference/win ... heck_files
Former Nagios employee
https://www.mcapra.com/
Locked