ChkLogsAdm
Section: Maintenance Commands (8)
Updated: 31 August 1997
Index
NAME
chklogsadm - ChkLogs Administrative program
SYNOPSIS
chklogsadm
command [ options[ parameters ]]
DESCRIPTION
The
chklogsadm
is an administrative Perl script to manage the
chklogs
configuration file.
This program exists to relieve chklogs from these administrative
issues and therefore allow it to do its job with less overhead.
chklogsadm
has a number of commands with its associated options to perform a
variety of tasks. Notice that not all options apply to every command,
and some commands do not take any options at all.
This program appeared on v1.8 of the ChkLogs package.
OPTIONS
The options appear always
after
the command, here is a summary of valid options:
- -g GROUP
-
Specify the group name. The only limitations for the group name is that it
must contain non-escapable characters so that it can be used as a
directory name. Commands: newgroup, gadd.
- -global GLOBAL_REPOSITORY
-
Specify the location of the global repository. Used when creating a new
configuration file. Another alternative is to use -local. Command: newconf.
- -local
-
Select a local repository method. This is the opposite to the -global
option when creating a new configuration. Command: newconf
- -force
-
Force creation of a new configuration file, overwriting the old one if
it exists. Command: newconf.
- -l LOG
-
Use to specify the logname, it must be a fully qualified name that is to
be added (by chklogsadm) to the configuration file. Commands: gadd, del.
- -b PROGRAM
-
Valid when specifying a group, it describes which program (and optionally
parameters) to execute
before
a group is checked during chklogs execution (%Pre instruction). Commands:
newgroup.
- -a PROGRAM
-
Valid when specifying a group, it describes which program (and optionally
parameters) to execute
after
a group is checked during chklogs execution (%Post instruction). Commands:
newgroup.
- -s THRESHOLD
-
Specify the threshold for a log file, this represents either a maximum size
in bytes or an age in months or days (append M or D). Commands: gadd.
- -a QUANTITY
-
Although it seems as a duplicate option it is actually context sensitive. It
tags the specified log with the
archive
action and takes as a parameter the number of archived logs to keep while
doing log rotation/shuffling. Commands: gadd.
- -e WHAT
-
Although it seems as a duplicate option it is actually context sensitive. It
tags the specified log with the
execute.
action, everything between this option and the next in the command line
is considered a command (and possibly parameters) to execute. Commands: gadd.
- -t
-
Used to tag the specified log with the
truncate
action. It takes no parameters. Commands: gadd.
- -t
-
In the context of the del command this option takes a parameter to specify
the (A)rchive, (T)runcate or (E)xecute tag. Commands: del.
- -v
-
Verbose. Use it when in command line mode to make sure things are
working ok before submitting a problem report.
- -m
-
Modify. Used in the context of the
newgroup
command to modify the group attributes.
COMMANDS
The command must be the first command line parameter to the chklogsadm
program. Below there is an explanation of what each of these commands
do and what options and parameters they take.
- init
-
Initialize. Whether you are upgrading from a release previous to v1.8
or installing ChkLogs for the first time you
must
execute this command, otherwise it will not work. You only need to do this
once as this creates administration files. It takes no parameters. This is
a destructive action in the sense that all the aging/action history in the
database (resource file) will be reset.
- initrepos
-
Initialize Repositories. This is different than a plain init and takes care
of creating repositories (directories) that are needed for chklogs to
work as chklogs runtime will not do this. You
must
use this command after init, and also whenever you add a new entry
(single or group) to the configuration and also whenever you associate an
entry with the
archive
action. These directories are necessary for the archival process!
- newgroup -g GROUP -b PREprocessingCmd -a POSTprocessingCmd [-m]
-
Create a Group Header. With this command you add the named GROUP to the
configuration with its respective %Pre and %Post instructions (and possibly
parameters). It takes care of generating the group terminator (empty or
comment line). All the parameters are compulsory. Attempt to create a group
that is already defined results in an error condition.
The modify (-m) flag is useful when wanting to modify the Pre and Post
(both!) attributes of the group. A prerequisite is that the group must
exist already otherwise the operation will result in an error condition.
- newconf { -local | -global GLOBAL_REPOSITORY } [-force]
-
Generate a new configuration file using a global or local repository. If
a configuration file already exists (see configuration variables) the
command will abort unless
-force
is specified, in this case the file will be overwritten. Command introduced
in 2.0 as a convenience to new users.
- rmgroup -g GROUP
-
Remove the named group header from the configuration file. Only the header
is removed so the logical group as an entity doesn't exist anymore. However
the logs that belonged to the group are left there, except the are now
inherited by the 'common' group.
- gadd -g GROUP -l LOG -s SIZE/AGE {-a QTY | -t | -e CMD }
-
The next logical step after the
newgroup
command or any time you need to add a new log specification to an
existing group. The mentioned options specify to which group to add
the new entry, the fully qualified name of the new log, the size in
bytes (threshold) or alternatively the threshold age in days (i.e.
25d) or months (i.e. 2m). Additionally the new log needs to be tagged
with
one
of the other 3 options: archive, truncate or execute. The group name
common
is reserved for addition of logs that don't belong to any group as is
the case for most.
- del -l LOG -t { A | T | E }
-
Remove the named log from the configuration. Since some logs may have two
entries such as execute plus either archive or truncate, the tag has
to be specified (A)rchive, (T)runcate or (E)xecute so only the one whose
tag matches is removed.
- sync
-
Synchronize. This option is needed whenever you add a new log to the
configuration or when you reorganize the order of the log entries in
the configuration file. If you don't sync ChkLogs will still function
properly but not as effectively as with sync'ed files.
- when LOG [ A | T | E ]
-
Although not formally part of the administration I used it for debugging.
It is used to inquire the ChkLogs package when a particular LOG was last
processed for
A
rchive,
T
runcate, or
E
xecute. If none of ATE is specified the first found entry is reported.
- syslog
-
Was used during debugging, it will report which logs and devices
ie /dev/console are being used by syslogd.
EXIT VALUE
Returns 0 upon success, non-zero otherwise.
SEE ALSO
chklogs(8), chklogs.conf(5), chklogsrc(5)
AUTHOR
Didimo Emilio Grimaldo Tunon (grimaldo@panama.IAEhv.nl)
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- OPTIONS
-
- COMMANDS
-
- EXIT VALUE
-
- SEE ALSO
-
- AUTHOR
-
This document was created by
man2html,
using the manual pages.
Time: 08:32:51 GMT, August 28, 1997