Page 1 of 1

check_newest_file_age problem with excluding

Posted: Tue Jun 03, 2014 2:29 pm
by lesnikov
Hi.

Im having problem with this plugin. I hope someone will help me out
The problem is I'm having problems excluding file types,
example in backup directory (backup root directory bac2014) I have backup files witch I need to monitor (backup file name:0001,0002,0003,0004)
the problem is I also have logs from backups in root directory witch are getting changed every minute (backup.log)
So if I run this plugin, plugin will say no warning no critical becouse he is checking logs witch have last time of 1min.

Is there any way to exclude file types from plugin search? like to exclude *.log etc..? So that plugin will search only backups not logs...


the plugin im using is:
http://exchange.nagios.org/directory/Pl ... ge/details

Best ragards

Re: check_newest_file_age problem with excluding

Posted: Tue Jun 03, 2014 3:38 pm
by abrist
First, this sub forum is for nagios-plugins - as in the package, so I will move this to general core.
This plugin does not support exclusions. You could alter the $file_list (line #282) var to include your exclusions:

Code: Select all

file_list=`ls -t $full_path | grep -v "log\|etc"`

Re: check_newest_file_age problem with excluding

Posted: Tue Jun 03, 2014 5:27 pm
by lesnikov
thank you. works perfectly

Re: check_newest_file_age problem with excluding

Posted: Wed Jun 04, 2014 11:12 am
by slansing
Excellent, thanks for letting us know!