Hi,
We are trying to monitor files that are not updated from 10 minutes using check_files plugin.
We are using below command
/usr/local/nagios/libexec/check_nrpe -H XXXXX -p 5666 -t 30 -c check_files -a path="E:\\Applications\\RTGF\\RTGFPolling\\Logs" pattern="`date +%Y%m%d`-RGTFLog.txt" "filter=written < -10m" 'critical=count>0' top-syntax='${status}: ${problem_count}/${count} files' 'empty-state=OK'
We are receiving alert with UNKNOWN state if no file older than 10 minutes.
Is it possible to get alert with OK state instead of UNKNOWN state ?
check_files plugin issue
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: check_files plugin issue
I think you need to change
to
Code: Select all
'empty-state=OK'Code: Select all
'empty-state=ok'Re: check_files plugin issue
I think you may have to move the quotes in the pattern section to get the command to work, try this example and see if this works for you.
Please post the full output.
If it still fails, run the following and post the output so we know the version of the NSClient you are running.
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H XXXXX -p 5666 -t 30 -c check_files -a path="E:\\Applications\\RTGF\\RTGFPolling\\Logs" 'pattern=`date +%Y%m%d`-RGTFLog.txt" "filter=written < -10m" 'critical=count>0' top-syntax='${status}: ${problem_count}/${count} files' 'empty-state=OK'If it still fails, run the following and post the output so we know the version of the NSClient you are running.
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H XXXXXBe sure to check out our Knowledgebase for helpful articles and solutions!
Re: check_files plugin issue
We tried with below command and it seems to be working for now.
/usr/local/nagios/libexec/check_nrpe -H XXXX -p 5666 -t 30 -c check_files -a path='E:\\Applications\\RTGF\\RTGFPolling\\Logs' "pattern=`date +%Y%m%d`-RGTFLog.txt" 'filter=written < -5m' 'critical=count>0' 'empty-state=ok' top-syntax='${status}: ${problem_count}/${count} files'
/usr/local/nagios/libexec/check_nrpe -H XXXX -p 5666 -t 30 -c check_files -a path='E:\\Applications\\RTGF\\RTGFPolling\\Logs' "pattern=`date +%Y%m%d`-RGTFLog.txt" 'filter=written < -5m' 'critical=count>0' 'empty-state=ok' top-syntax='${status}: ${problem_count}/${count} files'
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: check_files plugin issue
Excellent. glad it is working, going to lock this thread.