Monitor log file for inactivity?
Mark Young
myoung at nagios.org
Mon Jul 21 23:49:55 CEST 2008
On Jul 21, 2008, at 1:58 PM, Sean Carolan wrote:
> How would you use nagios to monitor a log file for inactivity? I was
> looking at the check_file_age plugin and thought it might work for
> this purpose.
It all depends on how the application writes to a log file. Simply
checking the log file for age or size might not determine if the
application is running accurately. If you are sure you want to check
the log file for age you will first have to figure out if the log file
is stored on the local monitoring machine or a remote machine. If it
is the local machine you can simply create a new command with the
check_file_age plugin and define a service for the local machine to
use. Otherwise if it is a remote machine you are going to need to run
the plugins using NRPE ( http://www.nagios.org/download/addons/ ) or
by SSH ( via plugin check_by_ssh ); for those you are going to need to
nagios plugins compiled on the remote machine.
For a local check you could use something like the following in your
commands.cfg and then add it as a service to your local box:
# 'check_file_age' command definition
define command{
command_name check_file_age
command_line $USER1$/check_file_age -w $ARG1$ -c $ARG2$ -f
$ARG3$ # $ARG3$ is the full path to the log file.
}
Or you might want to look on nagiosexchange.com to see if there is a
plugin created specifically for the program you are trying to check.
I would start by testing the plugins from the command line.
eg.
/path/to/check_file_age -h (for help)
/path/to/check_file_age -w 100 -c 1000 -f /path/to/logfile
I hope this helps!
Mark Young
___
Nagios Enterprises, LLC
Web: www.nagios.com
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list