Changeset 9fe8156b53dfebd170ae701a7f8f0d6d483392bb in xas-logmon


Ignore:
Timestamp:
12/22/15 14:02:44 (3 years ago)
Author:
Kevin L. Esteb <kevin@…>
Branches:
master
Children:
fc40813fa71d42020ea58cec1980a68e899b182d
Parents:
244bdd7d3e47c6cc2cbd7858e5ed8a6b6bbeda76
git-author:
Kevin L. Esteb <kevin@…> (12/22/15 14:02:44)
git-committer:
Kevin L. Esteb <kevin@…> (12/22/15 14:02:44)
Message:

updating documentation

Location:
trunk/lib/XAS
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/XAS/Apps/Logmon/Monitor.pm

    r244bdd7d3e47c6cc2cbd7858e5ed8a6b6bbeda76 r9fe8156b53dfebd170ae701a7f8f0d6d483392bb  
    6161            -pty            => 1, 
    6262            -command        => $command, 
    63             -auto_start     => $self->cfg->val($section, 'auto-start', TRUE), 
    64             -auto_restart   => $self->cfg->val($section, 'auto-restart', TRUE), 
     63            -auto_start     => 1, 
     64            -auto_restart   => 1, 
    6565            -directory      => Dir($self->cfg->val($section, 'directory', "/")), 
    6666            -environment    => $env, 
     
    130130 use XAS::Apps::Logmon::Monitor; 
    131131 
    132  
    133132=head1 DESCRIPTION 
    134133 
    135134This module will spawn multiple log monitoring processes. It will keep track 
    136 of them and restart them if they should stop. 
     135of them and restart them if they should die. Any output from the monitoring 
     136processes are written into the log file.  
     137 
     138=head1 CONFIGURATION 
     139 
     140The configuration file is the familiar Windows .ini format. It has the  
     141following stanzas. 
     142 
     143 [logmon: xas-spooler] 
     144 command = /usr/sbin/xas-logs 
     145 filename = /var/log/xas/xas-spooler.log 
     146 
     147This stanza defines a log file to monitor. There can be multiple stanzas. The 
     148"xas-spooler" in the stanzas name must be unique. Reasonable defaults 
     149have been defined for most of the properties. You really only need to use  
     150'filename' to start a monitoring process. 
     151 
     152The following properties may be used. 
     153 
     154=over 4 
     155 
     156=item B<command> 
     157 
     158This is the command to run. Defaults to /usr/sbin/xas-logs. 
     159 
     160=item B<filename> 
     161 
     162The file to monitor. Defaults to /var/log/xas/xas-spooler.log. 
     163 
     164=item B<spooldir> 
     165 
     166The spool directory to write messages. Defaults to /var/spool/xas/logs. 
     167 
     168=item B<ignore> 
     169 
     170The number of days prior to today to ignore. Defaults to 30. 
     171 
     172=back 
     173 
     174Please see L<XAS::Lib::Process|XAS::Lib::Process> for more details on the  
     175following parameters. 
     176 
     177=over 4 
     178 
     179=item B<directory> 
     180 
     181The default directory to set for the process. Defaults to "/". 
     182 
     183=item B<environment> 
     184 
     185Optional additional environment variables to pass to the process.  
     186 
     187=item B<exit-codes> 
     188 
     189The possible exit codes that might be returned if the process aborts. These 
     190are used to determine if the process should be restarted. Defaults to "0,1". 
     191This must be a comma delimited list of values. 
     192 
     193=item B<exit-retires> 
     194 
     195The number of retries for restarting the process. Defaults to "5". If this is 
     196"-1" then retries are unlimited. Use with caution. 
     197 
     198=item B<group> 
     199 
     200The group to run the process under. Defaults to "xas". Not implemented under 
     201Windows. 
     202 
     203=item B<priority> 
     204 
     205The priority to run the process under. Defaults to "0". Not implemented under 
     206Windows. 
     207 
     208=item B<umask> 
     209 
     210The umask to use for the process. Defaults to "0022". Not implemented under 
     211Windows. 
     212 
     213=item B<user> 
     214 
     215The user to run the process under. Defaults to "xas". Not implemented under 
     216Windows. 
     217 
     218=back 
    137219 
    138220=head1 METHODS 
     
    140222=head2 setup 
    141223 
    142 This method will process the config file and spawn log monitoring processes. 
     224This method will process the config file and spawn the log monitoring  
     225processes. 
    143226 
    144227=head2 main 
     
    148231=head2 options 
    149232 
    150 This method defines the command line options. 
     233No additional command line options are defined. 
    151234 
    152235=head1 SEE ALSO 
     
    154237=over 4 
    155238 
    156 =item L<XAS::Logmon> 
     239 
     240=item L<XAS::Logmon|XAS::Logmon> 
    157241 
    158242=item L<XAS|XAS> 
  • trunk/lib/XAS/Apps/Logmon/XAS/Process.pm

    re918af62879698c29f582a6413dda86cab8f98a9 r9fe8156b53dfebd170ae701a7f8f0d6d483392bb  
    159159=head1 NAME 
    160160 
    161 XAS::Apps::Log::Progress::AdminServer - A class to monitor a progress admin server log file 
     161XAS::Apps::Logmon::XAS::Process - A class to monitor XAS log files 
    162162 
    163163=head1 SYNOPSIS 
    164164 
    165  use XAS::Apps::Log::Progress::AdminServer; 
    166  
    167  my $app = XAS::Apps::Log::Progress::AdminServer->new() 
    168   
     165 use XAS::Apps::Logmon::XAS::Process; 
     166 
     167 my $app = XAS::Apps::Logmon::XAS::Process->new( 
     168     -throws => 'xas-logs' 
     169 ); 
     170 
    169171 exit $app->run; 
    170172  
    171173=head1 DESCRIPTION 
    172174 
     175This procedure will monitor XAS log files. It uses various means, depending on 
     176platform to determine when a file has changed. When a change occurs, this 
     177procedure will read until the end of file, parsing and creating messages as it 
     178goes. A status file is written into the directory of log file. It will have 
     179an extension of '.logmon'. On Linux/Unix this will be a hidden file. 
     180 
    173181=head1 METHODS 
    174182 
    175 =head2 method1 
     183=head2 setup 
     184 
     185This method will configure the process. 
     186 
     187=head2 main 
     188 
     189This method will start the processing.  
     190 
     191=head2 options 
     192 
     193This method provides these additonal cli options.  
     194 
     195=over 4 
     196 
     197=item B<--ignore> 
     198 
     199The number of days prior to today to ignore log lines. Defaults to 300. 
     200 
     201=item B<--process> 
     202 
     203The name of the process used to create the log file. Defaults to "xas-spooler". 
     204 
     205=item B<--spooldir> 
     206 
     207The spool director to use. Defaults to $XAS_SPOOL/logs. 
     208 
     209=item B<--filename> 
     210 
     211The name of the log file. Defaults to $XAS_LOG/xas-spooler.log. 
     212 
     213=back 
    176214 
    177215=head1 SEE ALSO 
     216 
     217=over 4 
     218 
     219=item L<XAS::Logmon::Input::Tail|XAS::Logmon::Input::Tail> 
     220 
     221=item L<XAS::Logmon::Filter::Merge|XAS::Logmon::Filter::Merge> 
     222 
     223=item L<XAS::Logmon::Output::Spool|XAS::Logmon::Output::Spool> 
     224 
     225=item L<XAS::Logmon::Format::Logstash|XAS::Logmon::Format::Logstash> 
     226 
     227=item L<XAS::Logmon::Parser::XAS::Logs|XAS::Logmon::Parser::XAS::Logs> 
     228 
     229=item L<XAS::Logmon::Process|XAS::Logmon::Process> 
     230 
     231=item L<XAS::Logmon|XAS::Logmon> 
     232 
     233=item L<XAS|XAS> 
     234 
     235=back 
    178236 
    179237=head1 AUTHOR 
  • trunk/lib/XAS/Docs/Logmon/Installation.pm

    r57ab731dbfc619ab99ce71ac415210d451fc3ba0 r9fe8156b53dfebd170ae701a7f8f0d6d483392bb  
    99=head1 NAME 
    1010 
    11 XAS::Docs::Logmon::Installation - how to install the XAS Logmon 
     11XAS::Docs::Logmon::Installation - how to install the XAS Log Monitor 
    1212 
    1313XAS is middleware for datacenter operations. It provides standardized methods,  
     
    3636On Unix like systems, using pure Perl, run the following commands: 
    3737 
    38     # perl Build.PL --installdirs site 
     38    # perl Build.PL --installdirs vendor 
    3939    # ./Build 
    4040    # ./Build test 
    4141    # ./Build install 
     42    # ./Build debian    # removes redhat specific files when installing on debian 
     43    # ./Build redhat    # removes debian specific files when installing on redhat 
    4244 
    4345If you are DEB based, Debian build files have been provided. If you have a  
  • trunk/lib/XAS/Logmon.pm

    r57ab731dbfc619ab99ce71ac415210d451fc3ba0 r9fe8156b53dfebd170ae701a7f8f0d6d483392bb  
    1212=head1 NAME 
    1313 
    14 XAS::Logmon - A set of modules and utilities to monitor log files 
    15  
    16 =head1 SYNOPSIS 
     14XAS::Logmon - A set of procedures and modules to monitor files 
    1715 
    1816=head1 DESCRIPTION 
     17 
     18Monitoring and extracting information from log files is an important task. 
     19There is important operational data stored in those files. They detail the 
     20state of your operations. These modules would compliment a centralized syslog  
     21gathering operationation. Even thou XAS can write to syslog or create JSON  
     22formatted log messages and spool them directly, these modules provide a  
     23framework that can be expanded to include other type of files. 
     24 
     25The design of this system is a monitoring process that spawns background jobs 
     26that do the actual work. Those background jobs are kept alive when file states 
     27change, such as file rotation or new file creation.  
     28 
     29A multi-process system is simpler to design and keep alive. It follows the XAS 
     30philosophy of small, simple components, that do one thing well. 
     31 
     32=head1 UTILITIES 
     33 
     34This module provides the following utilities. 
     35 
     36=head2 xas-logmon 
     37 
     38This is procedure is used to spawn and monitor file monitoring processes. It  
     39reads a configuration file to determine which files to monitor. 
     40 
     41The configuration file is documented here: L<XAS::Apps::Logmon::Monitor|XAS::Apps::Logmon::Monitor> 
     42 
     43=over 4 
     44 
     45=item xas-logmon --help 
     46 
     47This will display a brief help screen on command options. 
     48 
     49=item xas-logmon --manual 
     50 
     51This will display the utilities man page. 
     52 
     53=back 
     54 
     55=head2 xas-logs 
     56 
     57This procedure monitors XAS log files. It parses them and sends the results  
     58to a spool directory. 
     59 
     60=over 4 
     61 
     62=item xas-logs --help 
     63 
     64This will display a brief help screen on command options. 
     65 
     66=item xas-logs --manual 
     67 
     68This will display the utilities man page. 
     69 
     70=back 
    1971 
    2072=head1 SEE ALSO 
     
    2274=over 4 
    2375 
    24 =item L<XAS|XAS> 
     76=item L<XAS::Docs::Logmon::Installation|XAS::Docs::Logmon::Installation> 
    2577 
    26 =item L<XAS::Apps::Logmon::XAS::Monitor|XAS::Apps::Logmon::XAS::Monitor> 
     78=item L<XAS::Apps::Logmon::Monitor|XAS::Apps::Logmon::Monitor> 
    2779 
    2880=item L<XAS::Apps::Logmon::XAS::Process|XAS::Apps::Logmon::XAS::Process> 
     
    48100=item L<XAS::Logmon::Parser::XAS::Logs|XAS::Logmon::Parser::XAS::Logs> 
    49101 
     102=item L<XAS|XAS> 
     103 
    50104=back 
    51105 
     
    54108Kevin L. Esteb, E<lt>kevin@kesteb.usE<gt> 
    55109 
    56 =head1 LICENSE AND COPYRIGHT 
     110=head1 COPYRIGHT AND LICENSE 
    57111 
    58112Copyright (c) 2012-2015 Kevin L. Esteb 
  • trunk/lib/XAS/Logmon/Format/Logstash.pm

    rf0843dd161eaba2812d0b64e8feab0c20fd3df84 r9fe8156b53dfebd170ae701a7f8f0d6d483392bb  
    124124=over 4 
    125125 
    126 =item L<XAS::Logmon> 
     126=item L<XAS::Logmon|XAS::Logmon> 
    127127 
    128128=item L<XAS|XAS> 
  • trunk/lib/XAS/Logmon/Input/File.pm

    r57ab731dbfc619ab99ce71ac415210d451fc3ba0 r9fe8156b53dfebd170ae701a7f8f0d6d483392bb  
    4242    my $self = $class->SUPER::init(@_); 
    4343 
    44     $self->{fh} = $self->filename->open('r'); 
     44    $self->{'fh'} = $self->filename->open('r'); 
    4545 
    4646    return $self; 
     
    8383=over 4 
    8484 
    85 =item L<XAS::Logmon> 
     85=item L<XAS::Logmon::Input::Tail|XAS::Logmon::Input::Tail> 
     86 
     87=item L<XAS::Logmon|XAS::Logmon> 
    8688 
    8789=item L<XAS|XAS> 
  • trunk/lib/XAS/Logmon/Input/Tail.pm

    re918af62879698c29f582a6413dda86cab8f98a9 r9fe8156b53dfebd170ae701a7f8f0d6d483392bb  
    172172=over 4 
    173173 
    174 =item L<XAS::Logmon> 
     174=item L<XAS::Logmon::Input::File|XAS::Logmon::Input::File> 
     175 
     176=item L<XAS::Logmon::Input::Tail::Default|XAS::Logmon::Input::Tail::Default> 
     177 
     178=item L<XAS::Logmon::Input::Tail::Linux|XAS::Logmon::Input::Tail::Linux> 
     179 
     180=item L<XAS::Logmon::Input::Tail::Win32|XAS::Logmon::Input::Tail::Win32> 
     181 
     182=item L<XAS::Logmon|XAS::Logmon> 
    175183 
    176184=item L<XAS|XAS> 
  • trunk/lib/XAS/Logmon/Input/Tail/Default.pm

    r71b41918e7074bbc7a6c4c165197e3709e7a086b r9fe8156b53dfebd170ae701a7f8f0d6d483392bb  
    103103=over 4 
    104104 
    105 =item L<XAS::Logmon> 
     105=item L<XAS::Logmon::Input::Tail::Linux|XAS::Logmon::Input::Tail::Linux> 
     106 
     107=item L<XAS::Logmon::Input::Tail::Win32|XAS::Logmon::Input::Tail::Win32> 
     108 
     109=item L<XAS::Logmon::Input::Tail|XAS::Logmon::Input::Tail> 
     110 
     111=item L<XAS::Logmon|XAS::Logmon> 
    106112 
    107113=item L<XAS|XAS> 
  • trunk/lib/XAS/Logmon/Input/Tail/Linux.pm

    r71b41918e7074bbc7a6c4c165197e3709e7a086b r9fe8156b53dfebd170ae701a7f8f0d6d483392bb  
    212212=over 4 
    213213 
    214 =item L<XAS::Logmon> 
     214=item L<XAS::Logmon::Input::Tail::Default|XAS::Logmon::Input::Tail::Default> 
     215 
     216=item L<XAS::Logmon::Input::Tail::Win32|XAS::Logmon::Input::Tail::Win32> 
     217 
     218=item L<XAS::Logmon::Input::Tail|XAS::Logmon::Input::Tail> 
     219 
     220=item L<XAS::Logmon|XAS::Logmon> 
    215221 
    216222=item L<XAS|XAS> 
  • trunk/lib/XAS/Logmon/Input/Tail/Win32.pm

    r71b41918e7074bbc7a6c4c165197e3709e7a086b r9fe8156b53dfebd170ae701a7f8f0d6d483392bb  
    123123 
    124124This method is autoloaded when running on a Win32 platform. It uses 
    125 L<Win32::FileNotify|Win32::FileNotify> to monitor the file. 
     125L<Win32::FileNotify|https://metacpan.org/pod/Win32::FileNotify> to monitor  
     126the file. 
    126127 
    127128=head2 get 
     
    138139=over 4 
    139140 
    140 =item L<XAS::Logmon> 
     141=item L<XAS::Logmon::Input::Tail::Default|XAS::Logmon::Input::Tail::Default> 
     142 
     143=item L<XAS::Logmon::Input::Tail::Linux|XAS::Logmon::Input::Tail::Linux> 
     144 
     145=item L<XAS::Logmon::Input::Tail|XAS::Logmon::Input::Tail> 
     146 
     147=item L<XAS::Logmon|XAS::Logmon> 
    141148 
    142149=item L<XAS|XAS> 
  • trunk/lib/XAS/Logmon/Output/Spool.pm

    ref8b410a1c69084e675a8a870c49305c92afd8d1 r9fe8156b53dfebd170ae701a7f8f0d6d483392bb  
    112112=over 4 
    113113 
    114 =item L<XAS::Logmon> 
     114=item L<XAS::Logmon|XAS::Logmon> 
    115115 
    116116=item L<XAS|XAS> 
  • trunk/lib/XAS/Logmon/Parser/XAS/Logs.pm

    r1df84ff464af8fada2c57a51651fd18f5cf94202 r9fe8156b53dfebd170ae701a7f8f0d6d483392bb  
    111111=over 4 
    112112 
     113=item L<XAS::Log|XAS::Logmon> 
     114 
    113115=item L<XAS|XAS> 
    114  
    115 =item L<XAS::Log|XAS::Logmon> 
    116116 
    117117=item L<Regexp::Log|https://metacpan.org/pod/Regexp::Log> 
Note: See TracChangeset for help on using the changeset viewer.