File/Directory update time plugin

This package contains a plugin to check that a file/directory of files have a recent update to them.

This can be useful for checking for stale log files on systems that don't have other means of tracking the health of services.

To Install

First, download the Tar-file. Untar it in a temporary directory.

Simply run the 'install.pl' script. It will try to find your Nagios Plugins directory, and copy the plugins there. The user running the script must have privileges to write to the Nagios Plugins directory.

The installer will attempt to find out if all required Perl Modules are installed. If a module is not there, it will ask your permission to install it. If you are not root, however, it will simply tell you to do it, since in most cases only root can install Perl modules.

The plugin requires the 'Sys::Hostname' module to be installed. If you do not have it installed (most people do), the installation script will attempt to install it for you.

check_updatetime

The check_updatetime finds the latest update time for a file, or directory, and will report WARNING or CRITICAL if the most recent file is older than those thresholds

The plugin supports checking a single file, a directory, or a directory tree. The directory tree options will search all subdirectories recursively, while the 'simple' directory option will check the contents of a directory, but not traverse any subdirectories.

The plugin supports generating output suitable for send_nsca.

The following options are supported:

check_updatetime -d <directory> [-r] -c <critical_seconds> -w <warning_seconds> [-N -S <service_description> [-H <hostname>]]
check_updatetime -f <filename> -c <critical_seconds> -w <warning_seconds> [-N -S <service_description> [-H <hostname>]]

-d --directory=DIRECTORY
   Full path to the directory to be checked.
   '-d' or '-f' is required.
-f, --filename=FILENAME
   Full path to the single file to be monitored.
   '-d' or '-f' is required.
-r, --recursive
   Search recursively through all subdirectories for most
   recent file. Only valid with '-d' option.
   Beware that the algorithm used to traverse the directory
   tree is recursive, so if a large directory structure is
   searched, the script can consume very large amounts of
   memory on the stack.
-w --warn=WARNSECS
   If 'youngest' file is older than this number of seconds,
   and younger than CRITICALSECS, WARNING will be returned.
   Required.
-c --critical=CRITICALSECS
   If 'youngest' file is older than this number of seconds,
   CRITICAL will be returned. Required.
-N, --nsca
   Output formatted to suit the send_nsca command.
-O, --hostname=HOSTNAME
   Used when '-N' is defined. The name of the host, 
   corresponding to the 'host_name' parameter for the 
   service being checked, in the 'services.cfg' file on
   the Nagios server.
-S, --servicedesc=SERVICEDESCRIPTION
   Required when '-N' is defined. The name of the service
   being checked, as given in 'services.cfg' on the Nagios
   server.
-v, --verbose
   Print extra debugging information                                   

For Help

If you're having trouble with the plugin, don't hesitate to let me know.

Email me at pthomsen@reedtz.com, and I'll try to get back to you as soon as I can.


Contact | Blog | Software | Powered by
Get Firefox!