- Table of Contents
- Related Documents
-
Title | Size | Download |
---|---|---|
02-Information center commands | 116.21 KB |
Information center commands
display info-center
Use display info-center to display information center configuration.
Syntax
display info-center
Views
Any view
Predefined user roles
network-admin
network-operator
Examples
# Display information center configuration.
<Sysname> display info-center
Information Center: Enabled
Console: Enabled
Monitor: Enabled
Log host: Enabled
192.168.0.1,
port number: 5000, host facility: local7
Log buffer: Enabled
Max buffer size 1024, current buffer size 512,
Current messages 0, dropped messages 0, overwritten messages 0
Information timestamp format:
Log host: Date
Other output destination: Date
display logbuffer
Use display logbuffer to display log buffer information and buffered logs.
Syntax
display logbuffer [ reverse ] [ level severity | size buffersize ] * [ last-mins mins ]
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
reverse: Displays log entries chronologically, with the most recent entry at the top. If you do not specify this keyword, the command displays log entries chronologically, with the oldest entry at the top.
level severity: Specifies a severity level in the range of 0 to 7. If you do not specify a severity level, this command displays log information for all levels.
Severity value |
Level |
Description |
0 |
Emergency |
The system is unusable. For example, the system authorization has expired. |
1 |
Alert |
Action must be taken immediately. For example, traffic on an interface exceeds the upper limit. |
2 |
Critical |
Critical condition. For example, the device temperature exceeds the upper limit, the power module fails, or the fan tray fails. |
3 |
Error |
Error condition. For example, the link state changes. |
4 |
Warning |
Warning condition. For example, an interface is disconnected, or the memory resources are used up. |
5 |
Notification |
Normal but significant condition. For example, a terminal logs in to the device, or the device reboots. |
6 |
Informational |
Informational message. For example, a command or a ping operation is executed. |
7 |
Debugging |
Debugging message. |
size buffersize: Specifies the number of latest logs to be displayed. The value range is 1 to 1024. If you do not specify this option, the command displays all logs in the log buffer.
last-mins mins: Displays logs buffered over the last specified period of time. The mins argument specifies a time period in the range of 1 to 43200 minutes. If you do not specify a time period, the command displays all logs in the log buffer.
Examples
# Display log buffer information and buffered logs.
<Sysname> display logbuffer
Log buffer: Enabled
Max buffer size: 1024
Actual buffer size: 512
Dropped messages: 0
Overwritten messages: 718
Current messages: 512
%Jun 17 15:57:09:578 2017 Sysname SYSLOG/7/SYS_RESTART:System restarted --
…
# Display log buffer information and logs buffered over the last 5 minutes.
<Sysname> display logbuffer last-mins 5
Log buffer: Enabled
Max buffer size: 1024
Actual buffer size: 512
Dropped messages: 0
Overwritten messages: 0
Current messages: 191
%Jan 1 01:00:06:784 2011 Sysname SHELL/6/SHELL_CMD: -Line=vty0-IPAddr=192.168.1.242-User=**; Command is display current-configuration
%Jan 1 01:03:19:691 2018 Sysname SHELL/5/SHELL_LOGIN: VTY logged in from 192.168.1.33.
%Jan 1 01:03:21:269 2018 Sysname SHELL/6/SHELL_CMD: -Line=vty1-IPAddr=192.168.1.33-User=**; Command is display logbuffer last-mins 5
Table 2 Command output
Field |
Description |
Log buffer |
Status of the log buffer: · Enabled—Logs can be output to the log buffer. · Disabled—Logs cannot be output to the buffer. |
Max buffer size |
Maximum buffer size supported by the device. |
Actual buffer size |
Maximum buffer size configured by using the info-center logbuffer size command. |
Dropped messages |
Number of dropped messages. |
Overwritten messages |
Number of overwritten messages. |
Current messages |
Number of current messages. |
Related commands
info-center logbuffer
reset logbuffer
display logbuffer summary
Use display logbuffer summary to display the log buffer summary.
Syntax
display logbuffer summary [ level severity ]
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
level severity: Specifies a severity level in the range of 0 to 7. If you do not specify a severity level, this command displays log information of all levels in the log buffer. For more information about log levels, see Table 1.
Examples
# Display the summary of the log buffer.
<Sysname> display logbuffer summary
EMERG ALERT CRIT ERROR WARN NOTIF INFO DEBUG
0 0 0 0 22 0 1 0
Table 3 Command output
Field |
Description |
EMERG |
Represents emergency. For more information, see Table 1. |
ALERT |
Represents alert. For more information, see Table 1. |
CRIT |
Represents critical. For more information, see Table 1. |
ERROR |
Represents error. For more information, see Table 1. |
WARN |
Represents warning. For more information, see Table 1. |
NOTIF |
Represents notification. For more information, see Table 1. |
INFO |
Represents informational. For more information, see Table 1. |
DEBUG |
Represents debugging. For more information, see Table 1. |
enable log updown
Use enable log updown to enable an interface to generate link up or link down logs when the interface state changes.
Use undo enable log updown to disable an interface from generating link up or link down logs when the interface state changes.
Syntax
enable log updown
undo enable log updown
Default
All interfaces are allowed to generate link up and link down logs.
Views
Interface view
Predefined user roles
network-admin
Examples
# Disable GigabitEthernet 1/0/1 from generating link up or link down logs.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/0/1] undo enable log updown
info-center enable
Use info-center enable to enable the information center.
Use undo info-center enable to disable the information center.
Syntax
info-center enable
undo info-center enable
Default
The information center is enabled.
Views
System view
Predefined user roles
network-admin
Examples
# Enable the information center.
<Sysname> system-view
[Sysname] info-center enable
Information center is enabled.
info-center format
Use info-center format to set the format for logs sent to log hosts.
Use undo info-center format to restore the default.
Syntax
info-center format { cmcc | unicom }
undo info-center format
Default
Logs are sent to log hosts in standard format.
Views
System view
Predefined user roles
network-admin
Parameters
cmcc: Specifies the China Mobile Communications Corporation (CMCC) format.
unicom: Specifies the China Unicom format.
Usage guidelines
Logs can be sent to log hosts in standard, China Unicom, or CMCC format. For more information about log formats, see information center configuration in System Management Configuration Guide.
Examples
# Set the log format to China Unicom for logs sent to log hosts.
<Sysname> system-view
[Sysname] info-center format unicom
info-center logbuffer
Use info-center logbuffer to enable log output to the log buffer.
Use undo info-center logbuffer to disable log output to the log buffer.
Syntax
info-center logbuffer
undo info-center logbuffer
Default
Log output to the log buffer is enabled.
Views
System view
Predefined user roles
network-admin
Examples
# Enable log output to the log buffer.
<Sysname> system-view
[Sysname] info-center logbuffer
Related commands
display logbuffer
info-center enable
info-center logbuffer size
Use info-center logbuffer size to set the maximum number of logs that can be buffered.
Use undo info-center logbuffer size to restore the default.
Syntax
info-center logbuffer size buffersize
undo info-center logbuffer size
Default
A maximum of 512 logs can be buffered.
Views
System view
Predefined user roles
network-admin
Parameters
buffersize: Specifies the maximum log buffer size. The value range is 0 to 1024.
Examples
# Set the maximum log buffer size to 50.
<Sysname> system-view
[Sysname] info-center logbuffer size 50
# Restore the default maximum log buffer size.
<Sysname> system-view
[Sysname] undo info-center logbuffer size
Related commands
display logbuffer
info-center enable
info-center logging suppress duplicates
Use info-center logging suppress duplicates to enable duplicate log suppression.
Use undo info-center logging suppress duplicates to disable duplicate log suppression.
Syntax
info-center logging suppress duplicates
undo info-center logging suppress duplicates
Default
Duplicate log suppression is disabled.
Views
System view
Predefined user roles
network-admin
Usage guidelines
Outputting consecutive duplicate logs wastes system and network resources and increases device maintenance costs. You can enable this feature to suppress output of consecutive duplicate logs.
Examples
# Enable duplicate log suppression on device A.
<Sysname> system-view
[Sysname] info-center logging suppress duplicates
info-center loghost
Use info-center loghost to specify a log host and to configure output parameters.
Use undo info-center loghost to remove a log host.
Syntax
info-center loghost { hostname | ipv4-address | ipv6 ipv6-address } [ port port-number ] [ facility local-number ]
undo info-center loghost { hostname | ipv4-address | ipv6 ipv6-address }
Default
No log hosts are specified.
Views
System view
Predefined user roles
network-admin
Parameters
hostname: Specifies a log host by its name, a case-insensitive string of 1 to 253 characters. The host name can contain letters, digits, and special characters including hyphen (-), underscore (_), and dot (.).
ipv4-address: Specifies a log host by its IPv4 address.
ipv6 ipv6-address: Specifies a log host by its IPv6 address.
port port-number: Specifies the port number of the log host, in the range of 1 to 65535. The default is 514. It must be the same as the value configured on the log host. Otherwise, logs cannot be sent to the log host.
facility local-number: Specifies a logging facility from local0 to local7 for the log host. The default value is local7. Logging facilities are used to mark different logging sources, and query and filer logs.
Usage guidelines
The info-center loghost command takes effect only after the information center is enabled by using info-center enable command.
Examples
# Output logs to the log host at 1.1.1.1.
<Sysname> system-view
[Sysname] info-center loghost 1.1.1.1
Related commands
info-center source
info-center loghost source
Use info-center loghost source to specify a source IP address for logs sent to log hosts.
Use undo info-center loghost source to restore the default.
Syntax
info-center loghost source interface-type interface-number
undo info-center loghost source
Default
The source IP address of logs sent to log hosts is the primary IP address of the outgoing interface.
Views
System view
Predefined user roles
network-admin
Parameters
interface-type interface-number: Specifies an interface by its type and number.
Usage guidelines
The system uses the primary IP address of the specified interface as the source IP address of the logs sent to log hosts.
The info-center loghost source command takes effect only after the information center is enabled by using info-center enable command.
Examples
# Use the IP address of interface Loopback 0 as the source IP address of the logs sent to log hosts.
<Sysname> system-view
[Sysname] interface loopback 0
[Sysname-LoopBack0] ip address 2.2.2.2 32
[Sysname-LoopBack0] quit
[Sysname] info-center loghost source loopback 0
info-center source
Use info-center source to configure a log output rule for a module.
Use undo info-center source to restore the default.
Syntax
info-center source { module-name | default } { console | logbuffer | loghost | monitor } { deny | level severity }
undo info-center source { module-name | default } { console | logbuffer | loghost | monitor }
Default
Table 4 lists the default log output rules.
Destination |
Source modules |
Standard system log |
Security log |
Diagnostic log |
Hidden log |
Console |
All supported modules |
debugging |
Disabled |
Disabled |
Disabled |
Monitor terminal |
All supported modules |
debugging |
Disabled |
Disabled |
Disabled |
Log host |
All supported modules |
informational |
Disabled |
Disabled |
informational |
Log buffer |
All supported modules |
informational |
Disabled |
Disabled |
informational |
Views
System view
Predefined user roles
network-admin
Parameters
module-name: Specifies a module by its name. You can use the info-center source ? command to view the modules supported by the device.
default: Specifies all supported modules.
console: Outputs logs to the console.
logbuffer: Outputs logs to the log buffer.
loghost: Outputs logs to the log host.
monitor: Outputs logs to the monitor terminal.
deny: Disables log output.
level severity: Specifies a severity level in the range of 0 to 7. The smaller the severity value, the higher the severity level. See Table 1 for more information. Logs at the specified severity level and higher levels are allowed to be output.
Usage guidelines
If you do not set an output rule for a module, the module uses the output rule set by using the default keyword. If no rule is set by using the default keyword, the module uses the default output rule.
To modify or remove an output rule set for a module, you must use the module-name argument. A new output rule configured by using the default keyword does not take effect on the module.
If you execute this command for a module multiple times, the most recent configuration takes effect.
If you execute this command for the default modules multiple times, the most recent configuration takes effect.
Examples
# Output only VLAN module's information with the emergency level to the console.
<Sysname> system-view
[Sysname] info-center source default console deny
[Sysname] info-center source vlan console level emergency
# Based on the previous configuration, disable output of VLAN module's information to the console so no system information is output to the console.
<Sysname> system-view
[Sysname] undo info-center source vlan console
info-center synchronous
Use info-center synchronous to enable synchronous information output.
Use undo info-center synchronous to disable synchronous information output.
Syntax
info-center synchronous
Default
Synchronous information output is disabled.
Views
System view
Predefined user roles
network-admin
Usage guidelines
System log output interrupts ongoing configuration operations, including obscuring previously entered commands. Synchronous information output shows the obscured commands. It also provides a command prompt in command editing mode, or a [Y/N] string in interaction mode so you can continue your operation from where you were stopped.
Examples
# Enable synchronous information output, and then execute the display current-configuration command to view the current configuration of the device.
<Sysname> system-view
[Sysname] info-center synchronous
Info-center synchronous output is on
[Sysname] display current-
At this time, the system receives log information. It displays the log information first, and then displays your previous input, which is display current- in this example.
%May 21 14:33:19:425 2007 Sysname SHELL/5/SHELL_LOGIN: VTY logged in from 192.168.1.44
[Sysname] display current-
Enter configuration to complete the display current-configuration command, and press the Enter key to execute the command.
# Enable synchronous information output, and then save the current configuration (enter interactive information).
<Sysname> system-view
[Sysname] info-center synchronous
Info-center synchronous output is on
[Sysname] save
The current configuration will be written to the device. Are you sure? [Y/N]:
At this time, the system receives the log information. It displays the log information first and then displays [Y/N].
%May 21 14:33:19:425 2007 Sysname SHELL/5/SHELL_LOGIN: VTY logged in from 192.168.1.44
[Y/N]:
Enter Y or N to complete your input.
info-center syslog min-age
Use info-center syslog min-age to set the minimum storage period for logs in the log buffer and log file.
Use undo info-center syslog min-age to restore the default.
Syntax
info-center syslog min-age min-age
undo info-center syslog min-age
Default
The minimum storage period is not set.
Views
System view
Predefined user roles
network-admin
Parameters
min-age: Sets the minimum storage period in hours. The value range is 1 to 8760.
Examples
# Set the minimum storage period to 168 hours.
<Sysname> system-view
[Sysname] info-center syslog min-age 168
info-center timestamp
Use info-center timestamp to set the timestamp format for logs sent to the console, monitor terminal, log buffer, and log file.
Use undo info-center timestamp to restore the default.
Syntax
info-center timestamp { boot | date | none }
undo info-center timestamp
Default
The timestamp format for logs sent to the console, monitor terminal, log buffer, and log file is date.
Views
System view
Predefined user roles
network-admin
Parameters
boot: Sets the timestamp format to xxx.yyy, where xxx is the most significant 32 bits (in milliseconds) and yyy is the least significant 32 bits. For example, 0.21990989 equals Jun 25 14:09:26:881 2007. The boot time shows the time since system startup.
date: Sets the timestamp format to MMM DD hh:mm:ss:ms YYYY, such as Dec 8 10:12:21:708 2007. The date time shows the current system time.
· MMM: Abbreviations of the months in English, which could be Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, or Dec.
· DD: Date, starting with a space if it is less than 10, for example " 7".
· hh:mm:ss:ms: Local time, with hh in the range of 00 to 23, mm and ss in the range of 00 to 59, and ms in the range of 0 to 999.
· YYYY: Year.
none: Indicates no time information is provided.
Examples
# Set the timestamp format to boot for logs sent to the console, monitor terminal, log buffer, and log file.
<Sysname> system-view
[Sysname] info-center timestamp boot
Related commands
info-center timestamp loghost
info-center timestamp loghost
Use info-center timestamp loghost to set the timestamp format for logs sent to log hosts.
Use undo info-center timestamp loghost to restore the default.
Syntax
info-center timestamp loghost { date [ with-milliseconds ] | iso [ with-milliseconds ] | no-year-date | none }
undo info-center timestamp loghost
Default
The timestamp format for logs sent to log hosts is date.
Views
System view
Predefined user roles
network-admin
Parameters
date: Sets the timestamp format to MMM DD hh:mm:ss yyyy, such as Dec 8 10:12:21 2007. The date time shows the current system time.
iso: Sets the ISO 8601 timestamp format, for example, 2009-09-21T15:32:55.
with-milliseconds: Sets the timestamp to be accurate to milliseconds for logs output to log hosts in date or ISO 8601 format. The millisecond value is appended to the time information in the timestamp with a dot as the separator. If you do not specify this keyword, the timestamp in date or ISO 8601 format is accurate to seconds.
· Example of a timestamp in date format with millisecond accuracy: Dec 8 10:12:21.708 2018.
· Example of a timestamp in ISO 8601 format with millisecond accuracy: 2018-09-21T15:32:55.708.
no-year-date: Sets the timestamp format to the current system date and time without year.
none: Indicates that no timestamp information is provided.
Examples
# Set the timestamp format to no-year-date for logs sent to log hosts.
<Sysname> system-view
[Sysname] info-center timestamp loghost no-year-date
Related commands
info-center timestamp
reset logbuffer
Use reset logbuffer to clear the log buffer.
Syntax
reset logbuffer
Views
User view
Predefined user roles
network-admin
Examples
# Clear the log buffer.
<Sysname> reset logbuffer
Related commands
display logbuffer
terminal debugging
Use terminal debugging to enable output of debugging messages to the current terminal.
Use undo terminal debugging to disable output of debugging messages to the current terminal.
Syntax
terminal debugging
undo terminal debugging
Default
Output of debugging messages to the current terminal is disabled.
Views
User view
Predefined user roles
network-admin
Usage guidelines
This command enables output of debugging-level log messages to the current terminal.
To enable output of debugging messages to the console, perform the following tasks:
1. Execute the terminal debugging command.
2. Enable the information center. The information center is enabled by default.
3. Use a debugging command to enable the related debugging.
To enable output of debugging messages to the monitor terminal, perform the following tasks:
1. Execute the terminal monitor and terminal debugging commands.
2. Enable the information center. The information center is enabled by default.
3. Use a debugging command to enable the related debugging.
This command takes effect only for the current connection between the terminal and the device. If a new connection is established, the default is restored.
You can also enable output of debugging messages to the current terminal by executing the terminal logging level 7 command. The terminal logging level 7 command and the terminal debugging command have the following differences:
· The terminal logging level 7 command enables log output for all log severity levels (levels 0 through 7).
· The terminal debugging command enables log output for the following log severity levels:
¡ Debugging level (level 7).
¡ Severity level higher than or equal to the level specified in the terminal logging level command.
Examples
# Enable output of debugging messages to the current terminal.
<Sysname> terminal debugging
The current terminal is enabled to display debugging logs.
Related commands
terminal logging level
terminal monitor
terminal logging level
Use terminal logging level to set the lowest level of logs that can be output to the current terminal.
Use undo terminal logging level to restore the default.
Syntax
terminal logging level severity
undo terminal logging level
Default
The lowest level of logs that can be output to the current terminal is 6 (Informational).
Views
User view
Predefined user roles
network-admin
Parameters
severity: Specifies a log severity level. Valid values are alert, critical, debugging, emergency, error, informational, notification, warning, and digits from 0 to 7.
Usage guidelines
This command enables the device to output logs with a severity level higher than or equal to the specified level to the current terminal. For example, if you set the severity argument to 6, logs with a severity value from 0 to 6 are output to the current terminal.
This command takes effect only for the current connection between the terminal and the device. If a new connection is established, the default is restored.
Examples
# Configure the device to output logs with the debugging level and higher levels to the current terminal.
<Sysname> terminal logging level 7
terminal monitor
Use terminal monitor to enable log output to the current terminal.
Use undo terminal monitor to disable log output to the current terminal.
Syntax
terminal monitor
undo terminal monitor
Default
Log output to the console is enabled, and log output to the monitor terminal is disabled.
Views
User view
Predefined user roles
network-admin
Usage guidelines
This command takes effect only for the current connection between the terminal and the device. If a new connection is established, the default is restored.
Examples
# Enable log output to the current terminal.
<Sysname> terminal monitor