check_files plugin issue

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
bsivavani
Posts: 339
Joined: Tue Oct 06, 2015 9:17 am

check_files plugin issue

Post 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 ?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_files plugin issue

Post by scottwilkerson »

I think you need to change

Code: Select all

 'empty-state=OK'
to

Code: Select all

 'empty-state=ok'
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: check_files plugin issue

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
bsivavani
Posts: 339
Joined: Tue Oct 06, 2015 9:17 am

Re: check_files plugin issue

Post 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'
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_files plugin issue

Post by scottwilkerson »

Excellent. glad it is working, going to lock this thread.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked