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

<HTML><HEAD><TITLE>Manpage of chklogs.conf</TITLE>
</HEAD><BODY>
<H1>chklogs.conf</H1>
Section: File Formats (5)<BR>Updated: 28 August 1997<BR><A HREF="#index">Index</A>
<HR>


<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>

chklogs.conf - ChkLogs Configuration file
<A NAME="lbAC">&nbsp;</A>
<H2>DESCRIPTION</H2>

A
<I>chklogs.conf</I>

file contains instructions for the
<I><A HREF="chklogs-8.html">chklogs</A></I>(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.
<P>

Blank lines and leading spaces and tabs are ignored. Lines whose first
character is a pound/hash sign (#) are considered comments
<B>unless</B>

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
&quot;#:TOKEN &quot;. 
<P>
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</B>

is equivalent to
<B>-TOKEN value</B>

, all tokens are case insensitive.
<P>

<P>
The configuration file has two blocks: Settings and Instructions exactly
in that order. 
<P>
<A NAME="lbAD">&nbsp;</A>
<H2>GLOBAL SETTINGS BLOCK </H2>

The 
<B>Settings </B>

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.
<P>

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

</PRE>

<P>

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:
<P>
<DL COMPACT>
<DT><B>global</B>

<DD>
Use a global, centralized repository for archived logs.
<DT><B>local</B>

<DD>
Use a 
<I>./OldLogs</I>

directory to archive logs, this is directly under the directory in which
the current log is located.
</DL>
<P>

<P>
The global and local
<B>options</B>

are mutually exclusive, but if you neglect these instructions and indicate
both global and local options the program will work in global mode.
<P>

The third line contains the
<B>global</B>

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</B>

option is specified, otherwise it is ignored.
<P>
<A NAME="lbAE">&nbsp;</A>
<H2>INSTRUCTIONS BLOCK</H2>

<P>
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.
<P>

An instruction line is of the form:
<P>

<P>
<PRE>
  Fully-Qualified-Log-Name   Threshold  Action  [Parameters]
</PRE>

<P>

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</B>

will check 
<I>all</I>

the regular files (non-archives, non-directories) in the directory thus 
saving you from manually entering all the names in the configuration file.
<P>

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</I>

but also
<I>time-based </I>

thresholds. If the threshold contains only digits then this is assumed
to be a maximum size in bytes.
<P>

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:
<P>
<DL COMPACT>
<DT><DD>


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>

</DL>
<P>

<P>
The `d' and `m' qualifiers are case insensitive.
<P>

The 
<B>Action</B>

field can be either archive or truncate or execute. 
<I>Archive </I>

takes a compulsory parameter indicating what is the maximum number of
archives you want to keep, when the maximum is reached 
<B>ChkLogs </B>

performs 
<I>Log Shuffling</I>

so that your disk space isn't wasted with archives.
<P>
The 
<I>Truncate</I>

action takes no parameter and indicates that if the threshold condition is
met 
<B>ChkLogs</B>

is to truncate the file to zero size (you have been warned!).
<P>
Finally the 
<I>Execute</I>

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</B>

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.
<P>

Here are some examples of the three cases:
<P>

<P>
<PRE>
      /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
</PRE>

<P>

In addition to specification lines you can create 
<B>groups</B>

of logs. For each group of logs you can specify what program to execute
<I>before</I>

the first log is checked and which program to execute (not necessarily
the same)
<I>after</I>

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:
<P>

<PRE>
   #:group  innd
   #:Pre    /usr/sbin/ctlinnd pause
   #:Post   /usr/sbin/ctlinnd go
   /var/log/news/      10d    archive  5
   # A comment line is compulsory here
</PRE>

<P>

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.
<P>

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</B>

specify the 
<I>Pre </I>

and 
<I>Post </I>

entries, but leave them empty!. Example:
<P>

<PRE>

   # 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
</PRE>

<P>

<P>
<A NAME="lbAF">&nbsp;</A>
<H2>FILES</H2>

<PRE>
/etc/chklogs.conf
</PRE>

<P>
<A NAME="lbAG">&nbsp;</A>
<H2>SEE ALSO</H2>

<A HREF="chklogs-8.html">chklogs</A>(8), <A HREF="chklogsadm-8.html">chklogsadm</A>(8), <A HREF="chklogsrc-5.html">chklogsrc</A>(5)
<A NAME="lbAH">&nbsp;</A>
<H2>AUTHOR</H2>

<PRE>
Didimo Emilio Grimaldo Tunon &lt;<A HREF="mailto:grimaldo@panama.IAEhv.nl">grimaldo@panama.IAEhv.nl</A>&gt;
</PRE>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT><A HREF="#lbAB">NAME</A><DD>
<DT><A HREF="#lbAC">DESCRIPTION</A><DD>
<DT><A HREF="#lbAD">GLOBAL SETTINGS BLOCK </A><DD>
<DT><A HREF="#lbAE">INSTRUCTIONS BLOCK</A><DD>
<DT><A HREF="#lbAF">FILES</A><DD>
<DT><A HREF="#lbAG">SEE ALSO</A><DD>
<DT><A HREF="#lbAH">AUTHOR</A><DD>
</DL>
<HR>
This document was created by
<A HREF="http:/cgi-bin/man2html">man2html</A>,
using the manual pages.<BR>
Time: 08:31:36 GMT, August 28, 1997
</BODY>
</HTML>
Results 1 - 1
Help - FTP Sites List - Software Dir.
Searching half a billion files worldwide
© 1997-2009 MARUHN Internet Solutions