CheckFiles not working

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
wspackaging
Posts: 43
Joined: Mon Jul 15, 2013 10:36 am

CheckFiles not working

Post by wspackaging »

I have a CheckFile check_nrpe set up and it is returning 0 Files Found but yet the count still shows files.
Output:
{0 Files Found}|'count'=1053419;1000;2000

Command:
# /usr/local/nagios/libexec/check_nrpe -2 -H 10.100.30.107 -t 30 -c CheckFiles -a path='D:\\Apps_Vision_General\\Vision_Prod\\PrintFlow\\Inbox' pattern=*.* 'master-syntax={%total% Files Found}' MaxWarn=1000 MaxCrit=2000 'filter=size gt 0b'
{0 Files Found}|'count'=1053419;1000;2000

I can run the same command (obvious difference due to file path) and it works as expected.
# /usr/local/nagios/libexec/check_nrpe -2 -H 10.100.32.120 -t 30 -c CheckFiles -a path='D:\\Dell\\ArchiveManager\\Error' pattern=*.* 'master-syntax={%total% Files Found}' MaxWarn=2000 MaxCrit=5000 'filter=size gt 0b'
OK: All 1653 files are ok|'count'=1653;2000;5000

Any suggestions what I'm doing wrong here?

please advise
-pete
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: CheckFiles not working

Post by scottwilkerson »

Is the version of NSClient the same on both servers?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
wspackaging
Posts: 43
Joined: Mon Jul 15, 2013 10:36 am

Re: CheckFiles not working

Post by wspackaging »

The client is the same on both servers and the nsclient.ini file is the same on both servers.

Attached is the ini file
You do not have the required permissions to view the files attached to this post.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: CheckFiles not working

Post by mcapra »

I'm assuming these checks still alert (return the correct ok/warn/crit status) in the way you'd like them to? If not, you might try leveraging the count field in your warning/critical criteria like so (as a replacement for MaxWarn/MaxCrit):

Code: Select all

’warning=count>1000’ ’critical=count>2000’
More info here:
https://support.nagios.com/kb/article.php?id=783

total and count reference two different things.

Code: Select all

count        Number of items matching the filter. Common option for all checks.
...
total        Total number of items. Common option for all checks.
Though in this particular case, according to the documentation, both total and count should return the same value. That said, I've learned to not always trust the documentation for things.

Try switching the master-syntax argument to reference %count% instead and see if it produces the desired results.
Former Nagios employee
https://www.mcapra.com/
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: CheckFiles not working

Post by scottwilkerson »

I would try @mcapra's suggestion.

You may gave found a NSClient++ bug with directories that have that many files as your first command had 1053419 as the count
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
wspackaging
Posts: 43
Joined: Mon Jul 15, 2013 10:36 am

Re: CheckFiles not working

Post by wspackaging »

seems to be working now.
Not sure why. I'll open the ticket again if it starts failing again
-pete
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: CheckFiles not working

Post by scottwilkerson »

wspackaging wrote:seems to be working now.
Not sure why. I'll open the ticket again if it starts failing again
-pete
Great! Closing thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked