Fileage Check using NSClient++ 0.5.2.39 and up


(Thomas Speck) #1

Hi

I have a problem using my old fileage syntax, which was working fine up to NSClient++ 0.4.5.

I am using
check_nrpe -H WindowsHost -c CheckFiles -a path=C:/path/tofile pattern=file.type MaxCrit=1 “filter=written lt 10m”

Which up to now replied with “No files found|‘count’=0;0;1” and Exitcode 0 when everything is fine or “file.type|‘count’=1;0;1” and exit code 2 when the file was to old.

When trying the same command against the new NSClient++ Version, I get “No files found|‘count’=0;0;1” and exit code 3 (Unknown). I haven’t found out yet what was changed to fix the problem.


#2

Try check_files path=C:/path/tofile pattern=file.type “filter=written lt 10m” "crit=count>0" empty-state=OK
Maybe use max-depth=1 to not include other folders

Here is the link to the current docs and the check commands:
https://docs.nsclient.org/reference/windows/CheckDisk/#check_files

Out of interest:
Why are you not using an alias command in the nsclient.ini like
my_fileage_check = check_files path=C:/path/tofile pattern=file.type “filter=written lt 10m” crit=count>1
and call it with check_nrpe -H host -c my_fileage_check?

best regards :slight_smile:


(Thomas Speck) #3

At the moment I am testing in the command line of the icinga host doing the service-checks.

When calling your solution, I get the message that crit is deprecated and empty-state is unknown :wink:

For using the ini, what I am actually doing is calling the following

$USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -c CheckFiles -a path=$ARG1$ pattern=$ARG2$ MaxCrit=1 “filter=written < -$ARG3$”, with providing the Arguments for each incarnation of a fileage checking service.

so it is mostly already automated on the configuration level. Not to speak of the problems I also have with the change in placement of the .ini Entry for external checks/ aliases.

Anyway, thanks for the suggestion.


#4

That’s strange, because I’m using the exact command line with NSClient 0.5.2.35 :open_mouth:
check_files path="E:/this/Import/that/" pattern=*.err max-depth=1 "warn=count>0" "crit=count>1" empty-state=OK
Seems the documentation is not up to date with the program, I am confused, honestly :confused:


(Thomas Speck) #5

At the moment I have downgraded to 0.4.4, which works, 0.5.2 is at the moment still running on my workstation for testing purposes.