Page 1 of 1

Nrpe "checkfiles" problem

Posted: Mon Sep 07, 2015 3:33 am
by donlewis
Hi!
I have an "interesting" problem:
I want to run the following nrpe command in order to find a file(s) in a specific path:
/check_nrpe -n -H backserv -c checkfiles -a path="d:\\temp\\Backup\\1\\" pattern=*.tar filter="written > -8d" syntax="Backup files exist :%(name) size:%(size) bytes" MinWarn=0 MinCrit=0
First case: the specific file(s) exist, the command returns the following results (from nsclient log):
D disk Created command: warn=count<=0 crit=count<=0 "filter=written > -8d" pattern=*.tar "detail-syntax=Backup files exist :%(name) size:%(size) bytes" top-syntax=${list} path=d:\temp\Backup\1\ empty-state=ok
L cli OK: Backup files exist:filesize.tar size:24069 bytes
L cli Performance data: 'count'=1;0;0
Second case: the requested file(s) doesn't exist, so the command should run to "CRITICAL" state and gives back the following detailed results (from nsclient log):
D disk Created command: warn=count<=0 crit=count<=0 "filter=written > -8d" pattern=*.tar "detail-syntax=Backup files exist :%(name) size:%(size) bytes" top-syntax=${list} path=d:\temp\Backup\1\ empty-state=ok
L cli OK: No files found
L cli Performance data: 'count'=0;0;0
My question: WHY??? Why "cli OK" and not "cli CRITICAL"? In my opinion that's very embarassing and irritating.

Can you help me? Any help appreciated!

NSclient version: 0.4.3.143 2015-04-29

Thnx in advance,
Don Lewis

Re: Nrpe "checkfiles" problem

Posted: Mon Sep 07, 2015 7:34 pm
by Box293
This appears to be a bug with NSClient++ 0.4.3.143.

I tested with 0.4.105 and the behaviour is as it should be. Problem also occurs on 0.4.2.114 but with a slightly different output.

I suggest filing this as an issue on GitHub:
https://github.com/mickem/nscp