Filewatcher File Search
FTP Search
  
Directory 
  
Content Search 
   
pkg://chklogs-2.0-3.tar.gz:163018/chklogs-2.0-3/doc/chklogs.conf.5  downloads

.\"/* Copyright 1995,1996,1997 by D. Emilio Grimaldo T.
.\" * All rights reserved
.\" *
.\" * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
.\" * I'll try to keep a version up to date.  I can be reached as follows:
.\" * D. Emilio Grimaldo T. 	grimaldo@panama.IAEhv.nl
.\" */
.\"
.\" $Id: chklogs.5,v 1.3 1997/09/28 19:47:32 grimaldo Exp $
.\" 
.TH chklogs.conf 5 "28 August 1997"
.UC 4
.SH NAME
chklogs\.conf \- ChkLogs Configuration file
.SH DESCRIPTION
A
.I chklogs.conf
file contains instructions for the
.IR chklogs (8)
program so that it knows what action to perform when the examined log is
either too big or too old. The criteria is imposed by the user as explained
in the Instructions section.
.PP
Blank lines and leading spaces and tabs are ignored. Lines whose first
character is a pound/hash sign (#) are considered comments
.B unless
the first two characters of the line are #: in which case it is a
configuration line with a defined syntax. Tokens are embedded in comment
lines and begin with `:' so a configuration line will look like
"#:TOKEN ". 

As of Chklogs version 2.0 an alternative notation can be used,
so that configuration lines can begin with a dash (-) rather than the
two-character sequence, thus
.B #:TOKEN value
is equivalent to
.B -TOKEN value
, all tokens are case insensitive.
.PP

The configuration file has two blocks: Settings and Instructions exactly
in that order. 

.SH GLOBAL SETTINGS BLOCK 
The 
.B Settings 
section describes options that are valid throughout the 
execution of the program and are expected to be known before the 
Instructions block is interpreted. A full set of configuration settings
is shown below.
.PP

.nf
         #  Chklogs v1.9 Configuration (Enhanced syntax since v1.8)
         #:Options  global
         #:Global   /var/log/chklogs

.fi
.PP
The first line is just a comment and can be anywhere within the file. The
second line tells chklogs that we are about to set options. The options
after the token is a whitespace separated list of options. Currently the
following options are supported:

.TP
.B global
Use a global, centralized repository for archived logs.
.TP
.B local
Use a 
.I ./OldLogs
directory to archive logs, this is directly under the directory in which
the current log is located.
.PP

The global and local
.B options
are mutually exclusive, but if you neglect these instructions and indicate
both global and local options the program will work in global mode.
.PP
The third line contains the
.B global
token (not to be confused with option!) with a parameter/value that
represents a directory name. This directory is the root of the Global
Repository and is used if the 
.B global
option is specified, otherwise it is ignored.

.SH INSTRUCTIONS BLOCK

This section is the same you know from older (pre v1.8) versions of chklogs
with a few enhancements. Older versions of chklogs will still work properly.
In this block you can place three types of lines: comments, group
definitions and specification lines.
.PP
An instruction line is of the form:
.PP

.nf
  Fully-Qualified-Log-Name   Threshold  Action  [Parameters]
.fi 
.PP
The first field is the fully qualified filename of the log, therefore an
absolute path. As of version 1.8 this can also be simply a directory name
in which case 
.B ChkLogs
will check 
.I all
the regular files (non-archives, non-directories) in the directory thus 
saving you from manually entering all the names in the configuration file.
.PP
The second field is the threshold at which chklogs should perform the
specified action. As of v1.8 you can have not only 
.I size-based
but also
.I time-based 
thresholds. If the threshold contains only digits then this is assumed
to be a maximum size in bytes.
.PP
If on the other hand the threshold is a sequence of digits followed
(without spaces in between!) by either `D' or `M' then it is assumed
to be the maximum allowed age of the log in Days or Months respectively.
For example:

.IP
.ta 1.5i
Threshold   Meaning
.br
---------   --------------
.br
25000        Act upon if log is more than 25000 bytes
.br
15d          Act upon if age is 15 days or older
.br
3m           Act upon if age is 3 months or older
.br   
.PP

The `d' and `m' qualifiers are case insensitive.
.PP
The 
.B Action
field can be either archive or truncate or execute. 
.I Archive 
takes a compulsory parameter indicating what is the maximum number of
archives you want to keep, when the maximum is reached 
.B ChkLogs 
performs 
.I Log Shuffling
so that your disk space isn't wasted with archives.

The 
.I Truncate
action takes no parameter and indicates that if the threshold condition is
met 
.B ChkLogs
is to truncate the file to zero size (you have been warned!).

Finally the 
.I Execute
action takes one or more parameters. The first being the name of the 
program or script that you want to be executed when the threshold is
reached. This program will 
.B always
get the fully qualified log name as the first parameter!. If you specify
other parameters after the program name then these will also be passed
after the fully qualified logname, therefore as parameters 2..n.
.PP
Here are some examples of the three cases:
.PP

.nf
      /var/log/sendmail.st  1m     execute   cdk_mailstats
      /var/log/sendmail.st  1m     archive   3
      /var/log/messages     15000  truncate
      /var/log/cron         20d    truncate
.fi
.PP
In addition to specification lines you can create 
.B groups
of logs. For each group of logs you can specify what program to execute
.I before
the first log is checked and which program to execute (not necessarily
the same)
.I after
the last log of the group is checked. These pre and post executions are
done regardless of whether any of the grouped logs reached a threshold.
An trivial example would be:
.PP
.nf
   #:group  innd
   #:Pre    /usr/sbin/ctlinnd pause
   #:Post   /usr/sbin/ctlinnd go
   /var/log/news/      10d    archive  5
   # A comment line is compulsory here
.fi
.PP
The group name is a unique identifier that is used as a directory name
where the logs are archived (under the Global Repository) if the global
option is used, otherwise it is just a reference. The 'common' group name
is reserved.
.PP
The next two token lines (Pre/Post) specify which program (plus parameters) 
are to be executed before and after the group is checked. The end of a log
group is delimited by a comment or empty line (be warned! this is a common
configuration error!). Do note that even if you do not want or need Pre or
Post commands you still 
.B must
specify the 
.I Pre 
and 
.I Post 
entries, but leave them empty!. Example:
.PP
.nf

   # A Group Definition Without Pre/Post-processing
   #:group  samba
   #:Pre
   #:Post 
   /var/log/samba.nmb      10d    archive  5
   /var/log/samba.smb      10d    archive  5
   # A comment line is compulsory here
.fi
.PP

.SH FILES
.nf
/etc/chklogs.conf
.fi

.SH SEE ALSO
chklogs(8), chklogsadm(8), chklogsrc(5)
.SH AUTHOR
.nf
Didimo Emilio Grimaldo Tunon <grimaldo@panama.IAEhv.nl>
Results 1 - 1
Help - FTP Sites List - Software Dir.
Searching half a billion files worldwide
© 1997-2009 MARUHN Internet Solutions