Page 1 of 1

CheckFiles not working

Posted: Wed Aug 08, 2018 10:37 am
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

Re: CheckFiles not working

Posted: Wed Aug 08, 2018 4:17 pm
by scottwilkerson
Is the version of NSClient the same on both servers?

Re: CheckFiles not working

Posted: Mon Aug 13, 2018 10:46 am
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

Re: CheckFiles not working

Posted: Mon Aug 13, 2018 11:09 am
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.

Re: CheckFiles not working

Posted: Mon Aug 13, 2018 11:44 am
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

Re: CheckFiles not working

Posted: Thu Aug 30, 2018 3:01 pm
by wspackaging
seems to be working now.
Not sure why. I'll open the ticket again if it starts failing again
-pete

Re: CheckFiles not working

Posted: Thu Aug 30, 2018 3:25 pm
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