AIX 3.2* logs all warnings and errors, both hardware-
in the file /var/adm/ras/errlog. Entries are always
and are never deleted. All entries contain binary data.
administrator uses the command errpt to create a readable
output of this error log. No tools exist to automatically
severe errors or to notify the system administrator
of new entries
in the error log file. As a result, it's often the case
that the error
log file gets completely ignored. This is unfortunate
error log file contains vital information, such as disk
and adapter problems, which can't be ignored.
I present here two tools that I have developed to automate
They can be invoked on the command line or by cron.
purpose is to notify the system administrator of new
entries in the
error log file. The tools can be used for daily and
reporting and can mail the output to user root. Both
are shell scripts
which can be executed by either the Bourne or Korn shell.
The following commands are supplied by the AIX operating
are used in the scripts below.errclear <days> -- Removes all entries in
the error log file which are older than the number of
as the parameter. This command must be used to reduce
the size of
the error log file.
Daily Error Reporting
The shell script /var/adm/ras/daily (in Listing 1) generates
the daily error report. It is usually invoked by cron
can also be invoked from the command line.
This program mails all selected errors which occurred
-t), or since the last boot (default), to user root.
boot time is found in /etc/utmp and can be displayed
the command who -b. The program uses the errpt command
to extract entries from the system's error log.
Even if no errors occurred, daily mails its output to
to indicate that the error report program was executed.
In this case
the system administrator receives mail with an empty
message. A sample
output of errpt is shown in Figure 1.
As the figure shows, each line is a separate entry.
The first column
is a unique error identification. The second column
time the entry was made, in the format mmddhhmmyy (month,
hour, minute, and year). The third column describes
the error type,
which can be T (temporary), P (permanent), or U
(unknown). The fourth column describes the class of
the error, which
can be H (hardware), S (software), or O (entries
made by the super-user using the errlogger command).
column is the resource name of the software product
which made the
entry, and the last column is a verbose explanation
of the error.
A powerful report generator, errpt can select entries
error log file by time, error identifier, type of error
software), class of error (permanent, temporary), device
hardware errors, and product names for software errors.
If a spare terminal is available, errpt can be invoked
concurrent mode. All error log entries are reported
as soon as they
have been added to the error log file.
Monthly Error Reports
Daily reports are for system administrator notification.
logs are to be kept for a longer period of time, they
must be stored
elsewhere. This is mandatory: if the system's error
log file is not
reduced with the errclear command, the error log will
up all available disk space in that file system. The
script in Listing 2
groups error reports by month and stores them in a
It also cleans the system's error log file by deleting
from the previous month. cron invokes the script the
five days of each month.
This script keeps monthly error reports for exactly
one year. The
reports are stored in directory /var/adm/errors, which
to be created by the system administrator.
To automate the reporting, two entries are added to
file for user root. The first entry generates daily
The second entry invokes the monthly error reporting,
which also removes
last month's error log entries. This script is invoked
the first five
days each month, in case the system is shut down during
or bank holidays. The two crontab entries are as follows:
59 23 * * * /usr/bin/ksh /var/adm/errors/daily -t
59 23 1-5 * * /usr/bin/ksh /var/adm/errors/monthly
Now, when the system administrator logs in each day,
he or she will find a mail message containing a list
of the most recently
IBM. IBM AIX Commands Reference: Vol 2. GC23-2366-02.
About the Author
Thomas Richter has studied mathematics and Computer
at the University of Ulm, Germany. He has worked on
various UNIX platforms
as a software developer and C/C++ as main programming
projects include compiler construction, device drivers,
programming. He has also administered various UNIX machines
last 8 hears. He has worked for IBM UK since January