Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
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
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
Reviews (2)
byu.joss, May 11, 2017
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
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.
./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.