Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Kernel Logging in HP-UX 11i Version 1.5 > Chapter 1 Kernel Logging

Using Kernel Logging

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

Kernel Logging contributes to the high-availability of your system by giving system administrators and other troubleshooters the ability to collect the information necessary to diagnose problems in the HP-UX kernel while the system is still running. The cause of a system problem can often be tracked down without having to try to reproduce the problem or reboot the system. This is possible because, working in the background, while the system is running, KL logs messages detailing certain events that have taken place. The contents of the log are available to you at any time.

These three commands enable you to use and administer Kernel Logging:

kl

The kl command configures, and monitors the status of, the Kernel Logging infrastructure itself.

netfmt

The netfmt command formats the KL log files (which are binary) and allows you to get a human-readable report.

nettlconf

The nettlconf command configures the Kernel Logging subsystem database (allows you to control what gets logged).

Using kl to Enable, Disable, and Monitor Kernel Logging

The kl command controls the Kernel Logging infrastructure. It allows you to start and stop logging and determine its current status. kl can be used to specify the levels of events to be logged and the kernel subsystems that will write messages to memory or disk. kl also can also be used to manage the contents of the logfile in memory and on disk.

Procedure 1-5 Enabling KL on a Running System

  • Enable the KL infrastructure by executing the following command:

    #kl -e

    Note that, if the KL infrastructure is already enabled, reissuing this command does nothing and an error message (which may be disregarded) is issued.

Procedure 1-6 Disabling KL on a Running System

  • Disable the KL infrastructure by executing the following command:

    #kl -d

Procedure 1-7 Obtaining Configuration and Status Information About KL

You can obtain information, in the form of a report, about the status of the KL infrastructure. A typical report looks similar to this:

# kl -i
Kernel Logging Information:
Kernel Logging: ON
Kernel Logging Disk Writer: ON
Kernel Logging Picture (Snapshot): OFF
Current Queue Size: 100010485
Number of Messages Queued: 0
Log File name: /var/adm/kl.KLOG0
Log File size: 1048576 (minimum: 8192)
Subsystem Name: Log Class:
KL_VM ( 513) DISASTER
KL_PKM ( 514) DISASTER
KL_DLKM ( 515) DISASTER
KL_PM ( 516) DISASTER
KL_VFS ( 517) DISASTER
KL_VXFS ( 518) DISASTER

#

  • Obtain a status report on the KL infrastructure itself by executing the following command:

    #kl -i

Procedure 1-8 Using kl to Temporarily Reconfigure Kernel Logging

The file /etc/nettlgen.conf contains the default values for

  • the level of messages that will be logged

  • the subsystems from which that level of messages will be accepted

  • the maximum size of the log file

  • the maximum number of individual messages that will be logged

The only way these defaults can be permanently changed for your system is with the nettlconf command (see “Using nettlconf to Reconfigure the Default Level of Message Logging for a Kernel Subsystem”).

However, you can temporarily set new values for these aspects of KL, as described in this procedure.

  1. Temporarily set the appropriate level of message logging for a specific subsystem(s) by executing the following command:

    #kl -l level subsystem_ID ...

    For example, the following command sets level to INFORMATION for the KL_DLKM subsystem: #kl -l i KL_DLKM.

    That means that messages of classes DISASTER, ERROR, WARNING, and INFORMATIVE, coming from the KL_DLKM subsystem, will now be logged. Classes of messages coming from other subsystems remain unchanged.

    Complete definitions of level and subsystem_ID are given on the kl(1M) manpage.

  2. Temporarily set the size of the file used to store logged messages when write-to-disk is enabled, by executing the following command:

    #kl -s fsize

    The value of fsize is an integer in the range [8KB-1GB], optionally followed by the letter k, m, or g, to explicitly specify kilobytes, megabytes, or gigabytes (the default is bytes). fsize should be as large as your system can handle.

  3. Temporarily set the number of individual messages that will be stored in the log file by executing the following command:

    #kl -q qsize

    qsize must be an integer in the range [100-10000] representing the number of messages that can be logged. qsize should be as large as your system can handle.

  4. To restore the default values (as listed in the file /etc/nettlgen.conf) for any parameters you have temporarily changed:

    1. Disable Kernel Logging (kl -d).

    2. Enable Kernel Logging (kl -e).

Using kl and netfmt to Obtain and Format KL Reports

Procedure 1-9 Taking a Picture of the KL Logfile

Taking an isolated picture (a snapshot) of what's in memory and writing it out to disk is useful when you don't want to use system resources by having KL write to disk full-time.

  • Take a picture of the KL logfile and save it in filename, by executing the following command:

    #kl -p filename

    This causes all messages in memory to be dumped to filename and removed from memory.

Procedure 1-10 Obtaining Human-readable KL Reports

The KL logfile is a binary file. Before you can display or print logfile data in human-readable form, it must be formatted by the netfmt command. The formatted data is written to standard output by default, or to filename, if the -f option is specified.

  • Obtain human-readable output of the collected KL messages by executing the following command:

    # netfmt -k -v -f filename

    The following is an example of the output of this command:

    # netfmt -k -v -f kl.KLOG0 Time CPU SS PID TID CL ID ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~@#% 06/21/2000 19:18:53.969947 0 KL_MC -1 -1 E /ux/core/kern/em/svc/cmc.c: 441 0: 00 00 00 01 00 00 00 00 e0 00 00 00 00 17 a4 b8 ................ 16: 00 00 00 00 00 00 ff f6 83 55 ac e3 c8 97 db 10 .........U...... 32: 00 00 00 00 00 00 ff f6 00 00 00 00 00 00 00 1f ................ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~@#% 06/21/2000 19:19:02.553831 0 KL_MC -1 -1 E /ux/core/kern/em/svc/cmc.c: 441 0: 00 00 00 01 00 00 00 00 e0 00 00 00 00 17 a4 b8 ................ 16: 00 00 00 00 00 00 ff f6 83 55 ac e3 c8 97 db 10 .........U...... 32: 00 00 00 00 00 00 ff f6 00 00 00 00 00 00 00 1f ................ ========================== Kernel Log file Summary =========================== Node: hydra HP-UX Version: B.11.20 A Machine Type: ia64 Total number of messages: 2 Messages dropped: 0 Data dropped(bytes): 0 First Message Last Message Time: 19:18:53.969947 Time: 19:19:02.553831 Date: 06/21/00 Date: 06/21/00 Message distribution: Disaster: 0 Error: 2 Warning: 0 Informative: 0 ~~~~~~~~~~~~~Message distribution by Subsystem~~~~~~~~~~~~~ Subsystem Name: KL_MC Group Name: Kernel Logging Disaster: 0 Error: 2 Warning: 0 Informative: 0

Using nettlconf to Reconfigure the Default Level of Message Logging for a Kernel Subsystem

The nettlconf command is used primarily by developers to configure Kernel Logging for their product or kernel subsystem during installation. However, a system administrator or other users with appropriate privileges can use it to reconfigure the default level of messages that are logged for a given subsystem. Refer to the nettlconf(1M) manpage for complete information on using this command.

NOTE: It is not recommended that nettlconf be used to change any other aspects of the Kernel Logging infrastructure specified in the /etc/nettlgen.conf file. If this file becomes corrupted, the kl and netfmt commands will not function.

Using SAM to Administer Kernel Logging

Many of the system administrator's tasks discussed in the previous sections can be accomplished with SAM (System Administration Manager), a tool that provides an easy-to-use graphical interface for system setup and other administrative tasks. If you have appropriate privileges, or are logged in as root, you can access SAM by entering the command

/usr/sbin/sam

Once SAM is up and running, the KL administrative interface can be reached by the following path: select Kernel Configuration -> Configurable Parameters -> Actions -> Kernel Logging.

SAM has online help to assist you. You can also refer to the chapter "Using System Administration Manager" in "Managing Systems and Workgroups: A Guide for HP-UX System Administrators" for complete information on its use.

Kernel Logging Manual Pages

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2001 Hewlett-Packard Development Company, L.P.