Page 1 of 1

check_files plugin issue

Posted: Mon Sep 25, 2017 12:13 pm
by bsivavani
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 ?

Re: check_files plugin issue

Posted: Mon Sep 25, 2017 4:30 pm
by scottwilkerson
I think you need to change

Code: Select all

 'empty-state=OK'
to

Code: Select all

 'empty-state=ok'

Re: check_files plugin issue

Posted: Mon Sep 25, 2017 4:48 pm
by tgriep
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.

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'
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

Re: check_files plugin issue

Posted: Tue Sep 26, 2017 6:19 am
by bsivavani
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'

Re: check_files plugin issue

Posted: Tue Sep 26, 2017 9:03 am
by scottwilkerson
Excellent. glad it is working, going to lock this thread.