mickem / nscp

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

CheckFiles - unrecognised option 'empty-state=ok' #823

Open alexoalexo opened 5 months ago

alexoalexo commented 5 months ago

hello, I've tested 0.5.2.41, 0.5.3.4 and 0.6.0.1 and with all of them I'm not able to use empty-state option.

My goal is to check a single file and if its timestamp is older than 30min to raise an alarm. If it is fresh/recent (less than 30min old) then I need an OK state and not Unknown as returned when no files are found.

When the file is older than 30min, the command returns critical as expected. But when the files is fresh, the CheckFiles reports no file found and issues Unknown - 3

I want no files found to return OK, thus I try to use 'empty-state=ok' which is not availbale as it seems

CheckFiles  path='C:\alarms.csv' filter=written<-30m  MaxCrit=1  empty-state=ok
L        cli UNKNOWN: Invalid command line: unrecognised option 'empty-state=ok'

Thanks!

alexoalexo commented 4 months ago

Anyone has any ideas how to achieve this? I need to check single file timestamp, if older than X min then warn/crit. If it is fresh enough I need OK state.

Thank you!