Page 1 of 1

Check_file command

Posted: Wed May 24, 2017 9:27 am
by rambertnala
Hi friends. I am getting version from .exe file via check_nrpe.

My command is following

check_nrpe -H IP_ADDRESS -c check_file -a path=path/to/file pattern=file.exe "filter= (version = '1.1') or (version = '1.0')" "detail-syntax=%(filename): %(version)" "crit=version = '1.0' " "ok=version = '1.1' "

Well this is ok for me but if exe file version is 1.0 then output is

CRITICAL: 1/1 files (file.exe: 1.0)

but if exe file version is 1.1 output is

OK: All 1 files are ok

Why i don“t get same output??? In case OK: i don`t get version...but

Could be possible get one of these ouputs

CRITICAL: File.exe is version 1.0

OK: File.exe is version 1.1


Thanks and regards.

I forgot Nsclient++ version

0.4.3.143

Re: Check_file command

Posted: Wed May 24, 2017 12:50 pm
by mcapra
You could try altering the ok-syntax or detail-syntax of the command:
https://docs.nsclient.org/reference/win ... ail-syntax
https://docs.nsclient.org/reference/win ... _ok-syntax

This assumes you're using the check_files (plural) command for CheckDisk though. I don't recognize check_file:
https://docs.nsclient.org/reference/win ... heck_files

Re: Check_file command

Posted: Thu May 25, 2017 3:07 am
by rambertnala
Hi friends...

Yes check_files from CheckDisk....Sorry for my mistake...

At command

check_nrpe -H IP_ADDRESS -c check_file -a path=path/to/file pattern=file.exe "filter= (version = '1.1') or (version = '1.0')" "detail-syntax=%(filename): %(version)" "crit=version = '1.0' " "ok=version = '1.1' "

I am using "detail-syntax=%(filename): %(version)" so i will try ok-syntax and i will tell you

Re: Check_file command

Posted: Thu May 25, 2017 10:11 am
by dwhitfield
rambertnala wrote: i will try ok-syntax and i will tell you
Fantastic. Let us know!