check_nrpe check_files query

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
neworderfac33
Posts: 329
Joined: Fri Jul 24, 2015 11:04 am

check_nrpe check_files query

Post by neworderfac33 »

Good morning,
I'm running the following command:

Code: Select all

./check_nrpe -H 99.99.99.99 -c check_files -a "path=c:/windows/" pattern=*.exe "filter=version != '1.0'" "detail-syntax=%(filename): %(version)" "warn=count > 1" show-all
and it's reporting

Code: Select all

No files found|'count'=0;1;0
even though there are 8 .exe files in the c:\Windows folder, none of which have a version of 1.0

Just in case I'd misunderstood the functionality, I then changed the "1.0" to a version for which there was one file in the C:\Windows folder with that version, but the result was the same.

Can anyone suggest where I might be going wrong, please?
Thanks in advance
Pete
kyang

Re: check_nrpe check_files query

Post by kyang »

Which NSClient version are you running?

I have the same error when I'm running the command just as you are.

When I take out "filter=version != '1.0'", it works just fine.

Code: Select all

./check_nrpe -H 192.168.3.46 -c check_files -a "path=c:/windows/" pattern=*.exe "detail-syntax=%(filename): %(version)" "warn=count > 1"
WARNING: 0/3832 files (bfsvc.exe: 6.1.7601.17514, explorer.exe:
Although, I did check specific version #'s on 1 of the .exe and made it exact. It worked..

Code: Select all

./check_nrpe -H 192.168.3.46 -t 60 -c check_files -a "path=c:/windows/" pattern=*.exe "filter=version = '6.1.7600.16385'" "detail-syntax=%(filename): %(version)" "warn=count > 1"

WARNING: 0/1107 files (fveupdate.exe: 6.1.7600.16385, hh.exe: 6.1.7600.16385, regedit.exe: 6.1.7600.16385,
I think the issue is from this or at least something similar ---> "0.4.3 and 0.4.4 has a rather nasty issue when it comes to count which means it does not work for < cases. This has been fixed in 0.5.0"

https://forums.nsclient.org/t/checkfile ... -4-19/4058
neworderfac33
Posts: 329
Joined: Fri Jul 24, 2015 11:04 am

Re: check_nrpe check_files query

Post by neworderfac33 »

Thanks for replying - what you've given me helps me to get around the problem I have, now that I can check for a particular version against a particular file. I'm on 0.4.3.143, by the way.

Pete
kyang

Re: check_nrpe check_files query

Post by kyang »

Glad I could help, and that you found a workaround!

Did you have any more questions or are we okay to lock this up?
Locked