Build precise queries to find exactly what you need
Press ESC to close
Join our next live webinar: “Advanced Nagios Monitoring Techniques” – Register Now
Your review has been submitted and is pending approval.
This plugin pulls all files in each specified directory, and checks their created time against the current time. If the maximum age of any file is exceeded, a warning/critical message is returned as appropriate. This is useful for examining backup directories for freshness.
The only requirement is the bash shell interpreter, which most systems have installed by default.
Current Version
Last Release Date
June 22, 2009
Owner
Chad Phillips
Website
https://github.com/thehunmonkgroup/nagios-plugin-file-ages-in-dirs
Download URL
https://github.com/thehunmonkgroup/nagios-plugin-file-ages-in-dirs/releases/latest
Compatible With
The plugin is maintained on GitHub, visit here for more information.
Hi, it's possible to check against Windows directories? How? Thanks!
Works fine as a quick solution, only feature I miss is to be able to exclude files from a certain directory that will not be updated // are allowed to be older. Apart from that, it uses "Let" which seems to not-work on ubuntu that uses dash instead of bash: replace the /bin/sh with /bin/bash and you're fine.
Line 10 of this check_file_ages_in_dirs.sh has: " . $PROGPATH/utils.sh" This file is not in the download that I can see. In order to get this plugin working I needed to do the following: 1. Comment out the utils.sh "#. $PROGPATH/utils.sh" 2. Add the following below where utils.sh was " STATE_OK=0 STATE_WARNING=1 STATE_CRITICAL=2 STATE_UNKNOWN=3 " This makes the plugin work.
utils.sh is now provided with the package if you need it, RHEL/CentOS systems provide this file as part of the nagios-plugins package.
hi, How to check file freshness on Remote SMB/Windows Shares ?
The plugin *should* work for any directory structure that exists in the local filesystem. Haven't tested it specifically with something like NFS, and I've never used Samba, so can't speak to that.
On SLES 10 with Bash 3.1.17 the script needs some minor modifications that it works. I got these errors: line 299: let: FILE_AGE = 1335536854 - : syntax error: operand expected (error token is " ") line 300: let: FILE_AGE_UNITS = / 3600: syntax error: operand expected (error token is "/ 3600") line 303: [: -gt: unary operator expected line 306: [: -gt: unary operator expected How to fix it -------------- Line 294 from: st_ctime=`stat --printf=%Y ${next_filepath}` Line 294 to: st_ctime=`stat --format=%Y ${next_filepath}` Line 303 from: if [ $FILE_AGE -gt $MAX_CRIT_AGE ]; then Line 303 to: if [[ $FILE_AGE -gt $MAX_CRIT_AGE ]]; then Line 306 from: elif [ $FILE_AGE -gt $MAX_WARN_AGE ]; then Line 306 to: elif [[ $FILE_AGE -gt $MAX_WARN_AGE ]]; then Besides that nice work!
I have only modify 2 lines to allow listing of files named with space
Hi, I've read your information about your plugin and i want to use it, but i have a question. You can set warnings/crits on any given time, but can you also decide what the warning must say e.g.: "Warning: the file 'test.txt' is too long in this folder!!" ? I haven't tried your plugin YET, because i don't have a test environment YET. Can you please answer my question, it would make a whole difference ;-) Greetz Brownie
Very delayed reply, and, no, you currently can't set the content of the messages.
You must be logged in to submit a review.
To:
From: