Build precise queries to find exactly what you need
Press ESC to close
Your review has been submitted and is pending approval.
This Python script works on both Windows and *nix boxes and returns the date of the file (modified, access, or create) in human understandable form. (Only English.)
Current Version
Last Release Date
June 23, 2009
Owner
Nagios Exchange
File Age Check
Will check Windows serversharepathfile type addresses, but you may need to alter the NRPE Service privilege to do so. Return the basename of the file with the time date information as well as the type of time it checked.
Usage: check_fileage.py -f /mount/path/file.ext -w nnnn -c nnnn C|M -V -h
Tested on Window W2K3 and XP, and Centos 4.4 using Python 2.5
Thanks for the script. I had an additional requirement where a missing file is OK. I therefore extended the script with the optional parameters -x or -X to define the response on missing files. -x, --fail-on-not-exists Returns WARN if the file does not exist. -X, --ok-on-not-exists Returns OK if the file does not exist. If somebody is interested in that, you can find it here: https://github.com/ursjoss/check_fileage
###COMMAND OUTPUT### ./check_fileage.py -f /backup/192.168.10.10/rsync/nfs_file_logs -w 1440 -c 2880 Note:Here, 1440 means 1 days & 2880 means 2 days. Command Result is: OK: nfs_file_logs has a modified date of Mon 06 Aug/2012 18:41 Make below entry in "commands.cfg" define command{ command_name check_fileage command_line $USER1$/check_fileage.py -f n Fedora/CentOS/RedHat platform only.
You must be logged in to submit a review.
To:
From:
We’ve completely redesigned the world’s largest repository of Nagios plugins and monitoring tools. Join thousands of users sharing monitoring solutions for servers, applications, and everything in between.
Due to our redesign, all existing accounts require a password reset to access your account again.
Ready to explore 6,100+ projects and contribute to the community?
Reset Password Create Account
Happy Monitoring!