Monitoring-plugins-contentage
Nagios plugin
Vendor: SUSE Linux Products GmbH
Developer: User:lrupp
License: BSD-4-Clause
Web: http://en.opensuse.org/index.php?title=Monitoring-plugins-contentage
About
This plugin checks one or more directory for files older than a specified age. You can define the age of files for warning and critical states.
Note: the plugin checks the mtime of files, not the ctime.
Options
-w|--warning : time for warnings (minutes) -c|--critical : time for critical warnings (minutes) -p|--pathnames : absolute path to the folders, split mutliple pathnames with commata -t|--timeout : timeout (default: 15)
Check the local host
For checking the local machine running the nagios daemon, add a command definition like:
define command { command_name check_contentage command_line $USER1$/check_contentage -w 24 -c 48 -p $ARG1$ }
and define a service definition like:
define service{ use generic-service host_name localhost service_description Files in /tmp normal_check_interval 1440 # once a day display_name Old files in /tmp directory check_command check_contentage!/tmp }
Check remote hosts
This example uses the Nagios Remote Plugin Executor - you need the nrpe-client package installed on the machine you want to monitor and the nrpe-server package installed on the machine running the nagios daemon for this.
First, define a command definition on your nagios server like:
define command{ command_name check_nrpe command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ }
and a service definition like:
define service{ use generic-service host_name my_client service_description Old files in /tmp directory check_command check_nrpe!check_contentage-tmp }
On the client side, add the following line to your /etc/nrpe.cfg on the client machine:
command[check_contentage-tmp]=/usr/lib/nagios/plugins/check_contentage -w 24 -c 48 -p /tmp
to your nagios configuration.