NAME

XAS::Apps::Logmon::Monitor - A class for the XAS environment

SYNOPSIS

use XAS::Apps::Logmon::Monitor;

my $app = XAS::Apps::Logmon::Monitor->new(
    -throws => 'xas-logmon'
);

exit $app->run;

DESCRIPTION

This module will spawn multiple log monitoring processes. It will keep track of them and restart them if they should die. Any output from the monitoring processes are written into the log file.

CONFIGURATION

The configuration file is the familiar Windows .ini format. It has the following stanzas.

[logmon: xas-spooler]
command = /usr/sbin/xas-logs
filename = /var/log/xas/xas-spooler.log

This stanza defines a log file to monitor. There can be multiple stanzas. The "xas-spooler" in the stanzas name must be unique. Reasonable defaults have been defined for most of the properties. You really only need to use 'filename' to start a monitoring process.

The following properties may be used.

command

This is the command to run. Defaults to /usr/sbin/xas-logs.

filename

The file to monitor. Defaults to /var/log/xas/xas-spooler.log.

spooldir

The spool directory to write messages. Defaults to /var/spool/xas/logs.

ignore

The number of days prior to today to ignore. Defaults to 30.

Please see XAS::Lib::Process for more details on the following parameters.

directory

The default directory to set for the process. Defaults to "/".

environment

Optional additional environment variables to pass to the process. This should be in this form "key1=value1;;key2=value2".

exit-codes

The possible exit codes that might be returned if the process aborts. These are used to determine if the process should be restarted. Defaults to "0,1". This must be a comma delimited list of values.

exit-retires

The number of retries for restarting the process. Defaults to "5". If this is "-1" then retries are unlimited. Use with caution.

group

The group to run the process under. Defaults to "xas". Not implemented under Windows.

priority

The priority to run the process under. Defaults to "0". Not implemented under Windows.

umask

The umask to use for the process. Defaults to "0022". Not implemented under Windows.

user

The user to run the process under. Defaults to "xas". Not implemented under Windows.

METHODS

setup

This method will process the config file and spawn the log monitoring processes.

main

This method will start the processing.

options

No additional command line options are defined.

SEE ALSO

XAS::Logmon
XAS

AUTHOR

Kevin L. Esteb, <kevin@kesteb.us>

COPYRIGHT AND LICENSE

Copyright (c) 2012-2015 Kevin L. Esteb

This is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0. For details, see the full text of the license at http://www.perlfoundation.org/artistic_license_2_0.