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
CheckFiles not working
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: CheckFiles not working
Is the version of NSClient the same on both servers?
-
wspackaging
- Posts: 43
- Joined: Mon Jul 15, 2013 10:36 am
Re: CheckFiles not working
The client is the same on both servers and the nsclient.ini file is the same on both servers.
Attached is the ini file
Attached is the ini file
You do not have the required permissions to view the files attached to this post.
Re: CheckFiles not working
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):
More info here:
https://support.nagios.com/kb/article.php?id=783
total and count reference two different things.
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.
Code: Select all
’warning=count>1000’ ’critical=count>2000’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.
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/
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
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
You may gave found a NSClient++ bug with directories that have that many files as your first command had 1053419 as the count
-
wspackaging
- Posts: 43
- Joined: Mon Jul 15, 2013 10:36 am
Re: CheckFiles not working
seems to be working now.
Not sure why. I'll open the ticket again if it starts failing again
-pete
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
Great! Closing threadwspackaging wrote:seems to be working now.
Not sure why. I'll open the ticket again if it starts failing again
-pete