Title | Size | Download |
---|---|---|
08-Information Center Configuration | 193.15 KB |
Information center configuration
Introduction to information center
Classification of system information
System information channels and output destinations
Outputting system information by source module
Default output rules of system information
Configuring information center
Information center configuration task list
Outputting system information to the console
Outputting system information to a monitor terminal
Outputting system information to a log host
Outputting system information to the trap buffer
Outputting system information to the log buffer
Outputting system information to the SNMP module
Outputting system information to the web interface
Saving system information to a log file
Configuring synchronous information output
Disabling a port from generating link up/down logging information
Displaying and maintaining information center
Information center configuration examples
Outputting log information to a UNIX log host
Outputting log information to a Linux log host
Outputting log information to the console
Information center configuration
This chapter includes these sections:
· Information center configuration
· Configuring information center
· Displaying and maintaining information center
· Information center configuration examples
|
NOTE: · The term "switch" or "device" in this chapter refers to the switching engine on a WX3000E wireless switch. · The WX3000E series comprises WX3024E and WX3010E wireless switches. · The port numbers in this chapter are for illustration only. |
Information center overview
Introduction to information center
The information center classifies and manages system information, offering powerful support for network administrators and developers to monitor network performance and troubleshoot network problems.
The following describes the working process of information center:
· Receives the log, trap, and debugging information generated by each module.
· Outputs the above information to different information channels according to user-defined output rules.
· Outputs information to different destinations based on the information channel-to-destination associations.
To sum up, information center assigns the log, trap and debugging information to the 10 information channels according to the eight severity levels and then outputs the information to different destinations. The following describes the working process in detail.
Figure 1 Information center diagram
|
NOTE: By default, the information center is enabled. The information center affects system performance to some degree due to information classification and output. The impact becomes more obvious when the information center processes large amounts of information. |
Classification of system information
The system information of the information center falls into three types:
· Log information
· Trap information
· Debugging information
System information levels
The information is classified into eight levels by severity. The severity levels, in descending order are emergency, alert, critical, error, warning, notice, informational and debug. When system information is output by level, information with severity level higher than or equal to the specified level is output. For example, in the output rule, if you configure to output information with severity level being informational, the information with severity level being emergency through informational will be output.
Severity |
Severity value |
Description |
Corresponding keyword in commands |
Emergency |
0 |
The system is unusable. |
emergencies |
Alert |
1 |
Action must be taken immediately |
alerts |
Critical |
2 |
Critical conditions |
critical |
Error |
3 |
Error conditions |
errors |
Warning |
4 |
Warning conditions |
warnings |
Notice |
5 |
Normal but significant condition |
notifications |
Informational |
6 |
Informational messages |
informational |
Debug |
7 |
Debug-level messages |
debugging |
System information channels and output destinations
Table 2 shows the supported information channels and output destinations.
The system supports ten channels. By default, channels 0 through 6, and channel 9 are configured with channel names, output rules, and are associated with output destinations. The channel names, output rules and the associations between the channels and output destinations can be changed through commands. Besides, you can configure channels 7, and 8 without changing the default configuration of the eight channels.
Table 2 Information channels and output destinations
Information channel number |
Default channel name |
Default output destination |
Description |
0 |
console |
Console |
Receives log, trap and debugging information. |
1 |
monitor |
Monitor terminal |
Receives log, trap and debugging information, facilitating remote maintenance. |
2 |
loghost |
Log host |
Receives log, trap and debugging information and information will be stored in files for future retrieval. |
3 |
trapbuffer |
Trap buffer |
Receives trap information, a buffer inside the device for recording information. |
4 |
logbuffer |
Log buffer |
Receives log and debugging information, a buffer inside the device for recording information. |
5 |
snmpagent |
SNMP module |
Receives trap information. |
6 |
channel6 |
Web interface |
Receives log information. |
7 |
channel7 |
Not specified |
Receives log, trap, and debugging information. |
8 |
channel8 |
Not specified |
Receives log, trap, and debugging information. |
9 |
channel9 |
Log file |
Receives log, trap, and debugging information. |
|
NOTE: Configurations for the information output destinations function independently and take effect only after the information center is enabled. |
Outputting system information by source module
The system is composed of a variety of protocol modules, board drivers, and configuration modules. The system information can be classified, filtered, and output according to source modules. You can use the info-center source ? command to view the supported information source modules.
Default output rules of system information
The default output rules define the source modules allowed to output information on each output destination, the output information type, and the output information level as shown in Table 3, which indicates that by default and in terms of all modules:
· All log information is allowed to be output to the web interface and log file. Log information with severity level equal to or higher than informational is allowed to be output to the log host. Log information with severity level equal to or higher than informational is allowed to be output to the console, monitor terminal, and log buffer. Log information is not allowed to be output to the trap buffer and the SNMP module.
· All trap information is allowed to be output to the console, monitor terminal, log host, web interface, and log file. Trap information with severity level equal to or higher than informational is allowed to be output to the trap buffer and SNMP module. Trap information is not allowed to be output to the log buffer.
· All debugging information is allowed to be output to the console and monitor terminal. Debugging information is not allowed to be output to the log host, trap buffer, log buffer, the SNMP module, web interface, and log file.
Table 3 Default output rules for different output destinations
Output destination |
Modules allowed |
LOG |
TRAP |
DEBUG |
|||
Enabled/disabled |
Severity |
Enabled/disabled |
Severity |
Enabled/disabled |
Severity |
||
Console |
default (all modules) |
Enabled |
Informational |
Enabled |
Debug |
Enabled |
Debug |
Monitor terminal |
default (all modules) |
Enabled |
Informational |
Enabled |
Debug |
Enabled |
Debug |
Log host |
default (all modules) |
Enabled |
Informational |
Enabled |
Debug |
Disabled |
Debug |
Trap buffer |
default (all modules) |
Disabled |
Informational |
Enabled |
Informational |
Disabled |
Debug |
Log buffer |
default (all modules) |
Enabled |
Informational |
Disabled |
Debug |
Disabled |
Debug |
SNMP module |
default (all modules) |
Disabled |
Debug |
Enabled |
Informational |
Disabled |
Debug |
Web interface |
default (all modules) |
Enabled |
Debug |
Enabled |
Debug |
Disabled |
Debug |
Log file |
default (all modules) |
Enabled |
Debug |
Enabled |
Debug |
Disabled |
Debug |
System information format
The format of system information varies with the output destinations.
1. If the output destination is not the log host (such as console, monitor terminal, logbuffer, trapbuffer, SNMP, or log file), the system information is in the following format:
timestamp sysname module/level/digest:content
For example, a monitor terminal connects to the device. When a terminal logs in to the device, the log information in the following format is displayed on the monitor terminal:
%Jun 26 17:08:35:809 2008 Sysname SHELL/4/LOGIN: VTY login from 1.1.1.1
2. If the output destination is the log host, the system information is in one of the following formats:
· H3C format
<PRI>timestamp sysname %%vvmodule/level/digest: source content
For example, if a log host is connected to the device, when a terminal logs in to the device, the following log information is displayed on the log host:
<189>Oct 9 14:59:04 2009 MyDevice %%10SHELL/5/SHELL_LOGIN(l):VTY logged in from 192.168.1.21.
· UNICOM format
<PRI>timestamp sysname vvmodule/level/serial_number: content
|
NOTE: · The closing set of angel brackets < >, the space, the forward slash /, and the colon are all required in the above format. · The format in the previous part is the original format of system information, so you may see the information in a different format. The displayed format depends on the log resolution tools you use. |
What follows is a detailed explanation of the fields involved:
PRI (priority)
The priority is calculated using the following formula: facility*8+severity, in which facility represents the logging facility name and can be configured when you set the log host parameters. The facility ranges from local0 to local7 (16 to 23 in decimal integers) and defaults to local7. The facility is mainly used to mark different log sources on the log host, query and filter the logs of the corresponding log source. Severity ranges from 0 to 7. Table 1 details the value and meaning associated with each severity.
Note that the priority field takes effect only when the information has been sent to the log host.
timestamp
Times tamp records the time when system information is generated to allow users to check and identify system events. The time stamp of the system information sent from the information center to the log host is with a precision of milliseconds. The time stamp format of the system information sent to the log host is configured with the info-center timestamp loghost command, and that of the system information sent to the other destinations is configured with the info-center timestamp command. For the detailed description of the time stamp parameters, see the following table:
Table 4 Description on the time stamp parameters
Time stamp parameter |
Description |
Example |
boot |
System up time (that is, the duration for this operation of the device), in the format of xxxxxx.yyyyyy. xxxxxx represents the higher 32 bits, and yyyyyy represents the lower 32 bits. System information sent to all destinations except log host supports this parameter. |
%0.109391473 Sysname FTPD/5/FTPD_LOGIN: User ftp (192.168.1.23) has logged in successfully. 0.109391473 is a time stamp in the boot format. |
date |
Current date and time of the system, in the format of Mmm dd hh:mm:ss:sss yyyy. System information sent to all destinations supports this parameter. |
%May 30 05:36:29:579 2003 Sysname FTPD/5/FTPD_LOGIN: User ftp (192.168.1.23) has logged in successfully. May 30 05:36:29:579 2003 is a time stamp in the date format. |
iso |
Time stamp format stipulated in ISO 8601 Only the system information sent to a log host supports this parameter. |
<189>2003-05-30T06:42:44 Sysname %%10FTPD/5/FTPD_LOGIN(l): User ftp (192.168.1.23) has logged in successfully. 2003-05-30T06:42:44 is a time stamp in the iso format. |
none |
No time stamp is included. System information sent to all destinations supports this parameter. |
% Sysname FTPD/5/FTPD_LOGIN: User ftp (192.168.1.23) has logged in successfully. No time stamp is included. |
no-year-date |
Current date and time of the system, with year information excluded. Only the system information sent to a log host supports this parameter. |
<189>May 30 06:44:22 Sysname %%10FTPD/5/FTPD_LOGIN(l): User ftp (192.168.1.23) has logged in successfully. May 30 06:44:22 is a time stamp in the no-year-date format. |
Sysname (host name or host IP address)
· If the system information is sent to a log host in the format of UNICOM, and the info-center loghost source command is configured, the field is displayed as the IP address of the device that generates the system information.
· In other cases (when the system information is sent to a log host in the format of H3C, or sent to other destinations), the field is displayed as the name of the device that generates the system information, namely, the system name of the device. You can use the sysname command to modify the system name. For more information, see the Fundamentals Command Reference.
%% (vendor ID)
This field indicates that the information is generated by an H3C device. It is displayed only when the system information is sent to a log host in the format of H3C.
vv
This field is a version identifier of syslog, with a value of 10. It is displayed only when the output destination is log host.
module
The module field represents the name of the module that generates system information. You can enter the info-center source ? command in system view to view the module list.
level (severity)
System information can be divided into eight levels based on its severity, from 0 to 7. See Table 1 for definition and description of these severity levels. The levels of system information generated by modules are predefined by developers, and you cannot change the system information levels. However, with the info-center source command, you can configure to output information of the specified level and not to output information lower than the specified level.
digest
The digest field is a string of up to 32 characters, outlining the system information.
For system information destined to the log host:
· If the character string ends with (l), the information is log information
· If the character string ends with (t), the information is trap information
· If the character string ends with (d), the information is debugging information
For system information destined to other destinations:
· If the time stamp starts with a %, the information is log information
· If the time stamp starts with a #, the information is trap information
· If the time stamp starts with a *, the information is debugging information
serial number
This field indicates the serial number of the device that generates the system information. It is displayed only when the system information is sent to a log host in the format of UNICOM.
source
This field indicates the source of the information. It is optional and is displayed only when the system information is sent to a log host in the format of H3C.
content
This field provides the content of the system information.
Configuring information center
Information center configuration task list
Complete the following tasks to configure information center:
Task |
Remarks |
Optional |
|
Optional |
|
Optional |
|
Optional |
|
Optional |
|
Optional |
|
Optional |
|
Optional |
|
Optional |
|
Disabling a port from generating link up/down logging information |
Optional |
Outputting system information to the console
Outputting system information to the console
To do… |
Use the command… |
Remarks |
Enter system view |
system-view |
— |
Enable information center |
info-center enable |
Optional Enabled by default |
Name the channel with a specified channel number |
info-center channel channel-number name channel-name |
Optional See Table 2 for default channel names. |
Configure the channel through which system information can be output to the console |
info-center console channel { channel-number | channel-name } |
Optional By default, system information is output to the console through channel 0 (known as console). |
Configure the output rules of system information |
info-center source { module-name | default } channel { channel-number | channel-name } [ debug { level severity | state state } * | log { level severity | state state } * | trap { level severity | state state } * ] * |
Optional |
Configure the format of the time stamp |
info-center timestamp { debugging | log | trap } { boot | date | none } |
Optional The time stamp format for log, trap and debugging information is date by default. |
Enabling the display of system information on the console
After setting to output system information to the console, you need to enable the associated display function to display the output information on the console.
Follow these steps in user view to enable the display of system information on the console:
To do… |
Use the command… |
Remarks |
Enable the monitoring of system information on the console |
terminal monitor |
Optional Enabled on the console and disabled on the monitor terminal by default. |
Enable the display of debugging information on the console |
terminal debugging |
Required Disabled by default |
Enable the display of log information on the console |
terminal logging |
Optional Enabled by default |
Enable the display of trap information on the console |
terminal trapping |
Optional Enabled by default |
Outputting system information to a monitor terminal
System information can also be output to a monitor terminal, which is a user terminal that has login connections through the VTY user interface.
Outputting system information to a monitor terminal
To do… |
Use the command… |
Remarks |
Enter system view |
system-view |
— |
Enable information center |
info-center enable |
Optional Enabled by default |
Name the channel with a specified channel number |
info-center channel channel-number name channel-name |
Optional See Table 2 for default channel names. |
Configure the channel through which system information can be output to a monitor terminal |
info-center monitor channel { channel-number | channel-name } |
Optional By default, system information is output to the monitor terminal through channel 1 (known as monitor). |
Configure the output rules of the system information |
info-center source { module-name | default } channel { channel-number | channel-name } [ debug { level severity | state state } * | log { level severity | state state } * | trap { level severity | state state } * ] * |
Optional |
Configure the format of the time stamp |
info-center timestamp { debugging | log | trap } { boot | date | none } |
Optional By default, the time stamp format for log, trap and debugging information is date. |
Enabling the display of system information on a monitor terminal
After setting to output system information to a monitor terminal, you need to enable the associated display function in order to display the output information on the monitor terminal.
Follow these steps to enable the display of system information on a monitor terminal:
To do… |
Use the command… |
Remarks |
Enable the monitoring of system information on a monitor terminal |
terminal monitor |
Required Enabled on the console and disabled on the monitor terminal by default. |
Enable the display of debugging information on a monitor terminal |
terminal debugging |
Required Disabled by default |
Enable the display of log information on a monitor terminal |
terminal logging |
Optional Enabled by default |
Enable the display of trap information on a monitor terminal |
terminal trapping |
Optional Enabled by default |
Outputting system information to a log host
To do… |
Use the command… |
Remarks |
Enter system view |
system-view |
— |
Enable information center |
info-center enable |
Optional Enabled by default |
Name the channel with a specified channel number |
info-center channel channel-number name channel-name |
Optional See Table 2 for default channel names. |
Configure the output rules of the system information |
info-center source { module-name | default } channel { channel-number | channel-name } [ debug { level severity | state state } * | log { level severity | state state } * | trap { level severity | state state } * ] * |
Optional |
Specify the source IP address for the log information |
info-center loghost source interface-type interface-number |
Optional By default, the source interface is determined by the matched route, and the primary IP address of this interface is the source IP address of the log information. |
Configure the format of the time stamp for system information output to the log host |
info-center timestamp loghost { date | iso | no-year-date | none } |
Optional date by default. |
Set the format of the system information sent to a log host to UNICOM |
info-center format unicom |
Optional H3C by default. |
Specify a log host and configure the related output parameters |
info-center loghost { host-ipv4-address | ipv6 host-ipv6-address } [ port port-number ] [ channel { channel-number | channel-name } | facility local-number ] * |
Required By default, the system does not output information to a log host. If you specify to output system information to a log host, the system uses channel 2 (loghost) by default. The value of the port-number argument should be the same as the value configured on the log host, otherwise, the log host cannot receive system information. |
Outputting system information to the trap buffer
|
NOTE: The trap buffer receives the trap information only, and discards the log and debugging information even if you have configured to output them to the trap buffer. |
To do… |
Use the command… |
Remarks |
Enter system view |
system-view |
— |
Enable information center |
info-center enable |
Optional Enabled by default |
Name the channel with a specified channel number |
info-center channel channel-number name channel-name |
Optional See Table 2 for default channel names. |
Configure the channel through which system information can be output to the trap buffer and specify the buffer size |
info-center trapbuffer [ channel { channel-number | channel-name } | size buffersize ] * |
Optional By default, system information is output to the trap buffer through channel 3 (known as trapbuffer) and the default buffer size is 256. |
Configure the output rules of the system information |
info-center source { module-name | default } channel { channel-number | channel-name } [ debug { level severity | state state } * | log { level severity | state state } * | trap { level severity | state state } * ] * |
Optional |
Configure the format of the time stamp |
info-center timestamp { debugging | log | trap } { boot | date | none } |
Optional The time stamp format for log, trap and debugging information is date by default. |
Outputting system information to the log buffer
|
NOTE: You can configure to output log, trap, and debugging information to the log buffer, but the log buffer receives the log and debugging information only, and discards the trap information. |
To do… |
Use the command… |
Remarks |
Enter system view |
— |
|
Enable information center |
info-center enable |
Optional Enabled by default. |
Name the channel with a specified channel number |
info-center channel channel-number name channel-name |
Optional See Table 2 for default channel names. |
Configure the channel through which system information can be output to the log buffer and specify the buffer size |
info-center logbuffer [ channel { channel-number | channel-name } | size buffersize ] * |
Optional By default, system information is output to the log buffer through channel 4 (known as logbuffer) and the default buffer size is 512. |
Configure the output rules of the system information |
info-center source { module-name | default } channel { channel-number | channel-name } [ debug { level severity | state state } * | log { level severity | state state } * | trap { level severity | state state } * ] * |
Optional |
Configure the format of the time stamp |
info-center timestamp { debugging | log | trap } { boot | date | none } |
Optional The time stamp format for log, trap and debugging information is date by default. |
Outputting system information to the SNMP module
|
NOTE: The SNMP module receives the trap information only, and discards the log and debugging information even if you have configured to output them to the SNMP module. |
To monitor the device running status, trap information is usually sent to the SNMP network management station (NMS). In this case, you need to configure to send traps to the SNMP module, and then set the trap sending parameters for the SNMP module to further process traps. For more information, see the chapter “SNMP configuration.”
Follow these steps to configure to output system information to the SNMP module:
To do… |
Use the command… |
Remarks |
Enter system view |
system-view |
— |
Enable information center |
info-center enable |
Optional Enabled by default |
Name the channel with a specified channel number |
info-center channel channel-number name channel-name |
Optional See Table 2 for default channel names. |
Configure the channel through which system information can be output to the SNMP module |
info-center snmp channel { channel-number | channel-name } |
Optional By default, system information is output to the SNMP module through channel 5 (known as snmpagent). |
Configure the output rules of the system information |
info-center source { module-name | default } channel { channel-number | channel-name } [ debug { level severity | state state } * | log { level severity | state state } * | trap { level severity | state state } * ] * |
Optional |
Configure the format of the time stamp |
info-center timestamp { debugging | log | trap } { boot | date | none } |
Optional The time stamp format for log, trap and debugging information is date by default. |
Outputting system information to the web interface
This feature allows you to control whether to output system information to the web interface and which system information can be output to the web interface. The web interface provides abundant search and sorting functions; therefore, if you configure to output the system information to the web interface, you can view system information by clicking corresponding tabs after logging in to the device through the web interface.
Follow these steps to set to output system information to the web interface:
To do… |
Use the command… |
Remarks |
Enter system view |
system-view |
— |
Enable information center |
info-center enable |
Optional Enabled by default. |
Name the channel with a specified channel number |
info-center channel channel-number name channel-name |
Optional See Table 2 for default channel names. |
Configure the channel through which system information can be output to the web interface |
info-center syslog channel { channel-number | channel-name } |
Optional By default, system information is output to the web interface through channel 6. |
Configure the output rules of the system information |
info-center source { module-name | default } channel { channel-number | channel-name } [ debug { level severity | state state }* | log { level severity | state state }* | trap { level severity | state state }* ]* |
Optional |
Configure the format of the time stamp |
info-center timestamp { debugging | log | trap } { boot | date | none } |
Optional The time stamp format for log, trap and debugging information is date by default. |
|
NOTE: You can configure to output log, trap and debugging information to a channel. However, when this channel is bound with the output destination web interface, after logging in through the web interface, you can view log information of specific types only, and other types of information will be filtered out. |
Saving system information to a log file
This feature enables the device to save generated log information to a specified directory at a specified interval.
Logs are saved into the log file buffer. The system writes the logs from the log file buffer to the log file at the specified interval, which is usually set to 24 hours. You can also manually save the logs when the device is not busy. After the logs in the log file buffer are saved into the log file successfully, the system clears the log file buffer.
On devices that support a single log file: The log file has a specific capacity. When the capacity is reached, the system will delete the earliest messages and write new messages into the log file. Typically, the log file is saved in the directory /logfile/logfile.log.
Follow these steps to set to save system information to a log file:
To do… |
Use the command… |
Remarks |
Enter system view |
system-view |
— |
Enable information center |
info-center enable |
Optional Enabled by default |
Enable the log file feature |
info-center logfile enable |
Optional Enabled by default |
Configure the frequency with which the log file is saved |
info-center logfile frequency freq-sec |
Optional The default value is 86400. |
Configure the maximum storage space reserved for a log file |
info-center logfile size-quota size |
Optional The default value is 5M. |
Configure the directory to save the log file |
info-center logfile switch-directory dir-name |
Optional By default, it is the log file directory under the root directory of the flash. |
Manually save the log buffer content to the log file |
logfile save |
Optional Available in any view By default, the system saves the log file with the frequency defined by the info-center logfile frequency command. |
|
NOTE: To ensure that the device works normally, use the info-center logfile size-quota command to set a log file to be no smaller than 1 MB and no larger than 10 MB. |
Configuring synchronous information output
Synchronous information output refers to the feature that if the user’s input is interrupted by system output such as log, trap, or debugging information, then after the completion of system output the system will display a command line prompt (a prompt in command editing mode, or a [Y/N] string in interaction mode) and your input so far.
This command is used in the case that your input is interrupted by a large amount of system output. With this feature enabled, you can continue your operations from where you were stopped.
Follow these steps to enable synchronous information output:
To do… |
Use the command… |
Remarks |
Enter system view |
system-view |
— |
Enable synchronous information output |
info-center synchronous |
Required Disabled by default |
|
NOTE: · If system information, such as log information, is output before you input any information under the current command line prompt, the system will not display the command line prompt after the system information output. · If system information is output when you are inputting some interactive information (non Y/N confirmation information), then after the system information output, the system will not display the command line prompt but your previous input in a new line. |
Disabling a port from generating link up/down logging information
By default, all the ports of the device generate link up/down logging information when the port state changes. You may want to disable specific ports from generating such information in some cases, for example:
· You are only concerned with the states of some ports. In this case, you can use this function to disable other ports from generating link up/down logging information.
· A port is unstable, and continuously outputs logging information. In this case, you can disable the port from generating link up/down logging information.
Follow these steps to disable a port from generating link up/down logging information:
To do… |
Use the command… |
Remarks |
Enter system view |
system-view |
— |
Enter interface view |
interface interface-type interface-number |
— |
Disable the port from generating link up/down logging information |
undo enable log updown |
Required By default, all ports are allowed to generate link up/down logging information when the port state changes. |
|
NOTE: A port enabled with this feature does not output link up/down log information, and cannot be monitored conveniently. Therefore, H3C recommends that you use the default configuration in normal cases. |
Displaying and maintaining information center
To do… |
Use the command… |
Remarks |
Display information about information channels |
display channel [ channel-number | channel-name ] [ | { begin | exclude | include } regular-expression ] |
Available in any view |
Display the information of each output destination |
display info-center [ | { begin | exclude | include } regular-expression ] |
Available in any view |
Display the state of the log buffer and the log information recorded |
display logbuffer [ reverse ] [ level severity | size buffersize | slot slot-number ] * [ | { begin | exclude | include } regular-expression ] |
Available in any view |
Display a summary of the log buffer |
display logbuffer summary [ level severity | slot slot-number ] * [ | { begin | exclude | include } regular-expression ] |
Available in any view |
Display the content of the log file buffer |
display logfile buffer [ | { begin | exclude | include } regular-expression ] |
Available in any view |
Display the configuration of the log file |
display logfile summary [ | { begin | exclude | include } regular-expression ] |
Available in any view |
Display the state of the trap buffer and the trap information recorded |
display trapbuffer [ reverse ] [ size buffersize ] [ | { begin | exclude | include } regular-expression ] |
Available in any view |
Reset the log buffer |
reset logbuffer |
Available in user view |
Reset the trap buffer |
reset trapbuffer |
Available in user view |
Information center configuration examples
Outputting log information to a UNIX log host
Network requirements
· Send log information to a UNIX log host with an IP address of 1.2.0.1/16;
· Log information with severity higher than or equal to informational will be output to the log host;
· The source modules are ARP and IP.
Figure 2 Network diagram for outputting log information to a UNIX log host
Configuration procedure
Before the configuration, make sure that there is a route between Device and PC.
1. Configure the device
# Enable information center.
<Sysname> system-view
[Sysname] info-center enable
# Specify the host with IP address 1.2.0.1/16 as the log host, use channel loghost to output log information (optional, loghost by default), and use local4 as the logging facility.
[Sysname] info-center loghost 1.2.0.1 channel loghost facility local4
# Disable the output of log, trap, and debugging information of all modules on channel loghost.
[Sysname] info-center source default channel loghost debug state off log state off trap state off
|
CAUTION: As the default system configurations for different channels are different, you need to disable the output of log, trap, and debugging information of all modules on the specified channel (loghost in this example) first and then configure the output rule as needed so that unnecessary information will not be output. |
# Configure the information output rule: allow log information of ARP and IP modules with severity equal to or higher than informational to be output to the log host.
[Sysname] info-center source arp channel loghost log level informational state on
[Sysname] info-center source ip channel loghost log level informational state on
2. Configure the log host
The following configurations were performed on SunOS 4.0 which has similar configurations to the UNIX operating systems implemented by other vendors.
Step 1: Log in to the log host as a root user.
Step 2: Create a subdirectory named Device under directory /var/log/, and create file info.log under the Device directory to save logs of Device.
# mkdir /var/log/Device
# touch /var/log/Device/info.log
Step 3: Edit file /etc/syslog.conf and add the following contents.
# Device configuration messages
local4.info /var/log/Device/info.log
In the above configuration, local4 is the name of the logging facility used by the log host to receive logs. info is the information level. The UNIX system will record the log information with severity level equal to or higher than informational to file /var/log/Device/info.log.
|
NOTE: Be aware of the following issues while editing file /etc/syslog.conf: · Comments must be on a separate line and begin with the # sign. · No redundant spaces are allowed after the file name. · The logging facility name and the information level specified in the /etc/syslog.conf file must be identical to those configured on the device using the info-center loghost and info-center source commands; otherwise the log information may not be output properly to the log host. |
Step 4: After log file info.log is created and file /etc/syslog.conf is modified, you need to issue the following commands to display the process ID of syslogd, kill the syslogd process and then restart syslogd using the –r option to make the modified configuration take effect.
# ps -ae | grep syslogd
147
# kill -HUP 147
# syslogd -r &
After the above configurations, the system will be able to record log information into the log file.
Outputting log information to a Linux log host
Network requirements
· Send log information to a Linux log host with an IP address of 1.2.0.1/16;
· Log information with severity equal to or higher than informational will be output to the log host;
· All modules can output log information.
Figure 3 Network diagram for outputting log information to a Linux log host
Configuration procedure
Before the configuration, make sure that there is a route between Device and PC.
1. Configure the device
# Enable information center.
<Sysname> system-view
[Sysname] info-center enable
# Specify the host with IP address 1.2.0.1/16 as the log host, use channel loghost to output log information (optional, loghost by default), and use local5 as the logging facility.
[Sysname] info-center loghost 1.2.0.1 channel loghost facility local5
# Disable the output of log, trap, and debugging information of all modules on channel loghost.
[Sysname] info-center source default channel loghost debug state off log state off trap state off
|
CAUTION: As the default system configurations for different channels are different, you need to disable the output of log, trap, and debugging information of all modules on the specified channel (loghost in this example) first and then configure the output rule as needed so that unnecessary information will not be output. |
# Configure the information output rule: allow log information of all modules with severity equal to or higher than informational to be output to the log host.
[Sysname] info-center source default channel loghost log level informational state on
2. Configure the log host
Step 1: Log in to the log host as a root user.
Step 2: Create a subdirectory named Device under directory /var/log/, and create file info.log under the Device directory to save logs of Device.
# mkdir /var/log/Device
# touch /var/log/Device/info.log
Step 3: Edit file /etc/syslog.conf and add the following contents.
# Device configuration messages
local5.info /var/log/Device/info.log
In the above configuration, local5 is the name of the logging facility used by the log host to receive logs. info is the information level. The Linux system will record the log information with severity level equal to or higher than informational to file /var/log/Device/info.log.
|
NOTE: Be aware of the following issues while editing file /etc/syslog.conf: · Comments must be on a separate line and begin with the # sign. · No redundant spaces are allowed after the file name. · The logging facility name and the information level specified in the /etc/syslog.conf file must be identical to those configured on the device using the info-center loghost and info-center source commands; otherwise the log information may not be output properly to the log host. |
Step 4: After log file info.log is created and file /etc/syslog.conf is modified, you need to issue the following commands to display the process ID of syslogd, kill the syslogd process, and restart syslogd using the -r option to make the modified configuration take effect.
# ps -ae | grep syslogd
147
# kill -9 147
# syslogd -r &
|
NOTE: Ensure that the syslogd process is started with the -r option on a Linux log host. |
After the above configurations, the system will be able to record log information into the log file.
Outputting log information to the console
Network requirements
· Log information with a severity equal to or higher than informational will be output to the console;
· The source modules are ARP and IP.
Figure 4 Network diagram for sending log information to the console
Configuration procedure
# Enable information center.
<Sysname> system-view
[Sysname] info-center enable
# Use channel console to output log information to the console (optional, console by default).
[Sysname] info-center console channel console
# Disable the output of log, trap, and debugging information of all modules on channel console.
[Sysname] info-center source default channel console debug state off log state off trap state off
|
CAUTION: As the default system configurations for different channels are different, you need to disable the output of log, trap, and debugging information of all modules on the specified channel (console in this example) first and then configure the output rule as needed so that unnecessary information will not be output. |
# Configure the information output rule: allow log information of ARP and IP modules with severity equal to or higher than informational to be output to the console.
[Sysname] info-center source arp channel console log level informational state on
[Sysname] info-center source ip channel console log level informational state on
[Sysname] quit
# Enable the display of log information on a terminal. (Optional, this function is enabled by default.)
<Sysname> terminal monitor
Info: Current terminal monitor is on.
<Sysname> terminal logging
Info: Current terminal logging is on.
After the above configuration takes effect, if the specified module generates log information, the information center automatically sends the log information to the console, which displays the information.