Check_file command

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
rambertnala
Posts: 60
Joined: Fri Feb 26, 2016 7:15 am

Check_file command

Post 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
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Check_file command

Post 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
Former Nagios employee
https://www.mcapra.com/
rambertnala
Posts: 60
Joined: Fri Feb 26, 2016 7:15 am

Re: Check_file command

Post 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
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Check_file command

Post by dwhitfield »

rambertnala wrote: i will try ok-syntax and i will tell you
Fantastic. Let us know!
Locked