mickem / nscp

NSClient++
http://nsclient.org
GNU General Public License v2.0
239 stars 94 forks source link

Check_file no warning when path doesn't exist #613

Open peterdkdp opened 5 years ago

peterdkdp commented 5 years ago

Issue and Steps to Reproduce

When using check_files to monitor the number files in a folder that doesn't exist, we receive a OK state back with "No files found". So, no warning or unknown state saying that the folder does not exist. We only found the errors in the nsclient.log: error:c:\source\master\modules\CheckDisk\file_finder.cpp:107: Invalid file specified error:c:\source\master\modules\CheckDisk\file_finder.cpp:107: File was NOT found!

COMMAND: $USER1$/check_nrpe_v3 -2 -P 10240 -H server -p 5666 -t 120 -c check_files -a $ARG1$

ARG1: path='\\full\path' pattern=*.* 'critical=count>0' 'empty-state=ok'

Expected Behavior

To get a UNKNOWN or WARNING state when the folder is missing.

Actual Behavior

We get OK back.

Details

Additional Details

NSClient++ log:

Two necessary error are stated above.