30-信息中心命令
本章节下载: 30-信息中心命令 (178.16 KB)
目 录
1.1.4 display logbuffer summary
1.1.6 info-center channel name
1.1.7 info-center console channel
1.1.11 info-center loghost source
1.1.12 info-center monitor channel
1.1.13 info-center snmp channel
1.1.15 info-center synchronous
1.1.17 info-center timestamp loghost
1.1.18 info-center timestamp utc
【命令】
display channel [ channel-number | channel-name ]
【视图】
任意视图
【参数】
channel-number:通道号,取值范围为0~9,即系统可以有10个通道。
channel-name:通道名。缺省情况下,通道0~9的名称分别为console,monitor,loghost,trapbuffer,logbuffer,snmpagent,channel6,channel7,channel8,channel9。
【描述】
display channel命令用来显示信息通道的内容。
不带参数时,命令将显示所有通道的设置情况。
【举例】
# 显示0号信息通道的内容。
<device> display channel 0
channel number:0, channel name:console
MODU_ID NAME ENABLE LOG_LEVEL ENABLE TRAP_LEVEL ENABLE DEBUG_LEVEL
ffff0000 default Y warning Y debugging Y debugging
【命令】
display info-center [ unit unit-id ]
【视图】
任意视图
【参数】
unit-id:设备的Unit的编号,取值为1。
【描述】
display info-center命令用来显示信息中心工作状态、各信息输出通道的配置、时间戳格式。
相关配置可参考命令info-center enable、info-center loghost、info-center logbuffer、info-center console channel、info-center monitor channel、info-center trapbuffer、info-center snmp channel和info-center timestamp。
【举例】
# 查看当前系统中的信息中心工作状态、各信息输出通道的配置、时间戳格式。
<device> display info-center
Information Center: enabled
Log host:
the interface name of the source address : Vlan-interface1
192.168.0.2, channel number : 2, channel name : loghost
language : english, host facility local : 7
Console:
channel number : 0, channel name : console
Monitor:
channel number : 1, channel name : monitor
SNMP Agent:
channel number : 5, channel name : snmpagent
Log buffer:
enabled,max buffer size : 1024, current buffer size : 512,
current messages : 512, channel number : 4, channel name : logbuffer
dropped messages : 0, overwritten messages : 586
Trap buffer:
enabled,max buffer size : 1024, current buffer size : 256,
current messages : 5, channel number : 3, channel name : trapbuffer
dropped messages : 0, overwritten messages : 0
Information timestamp setting:
log - date, trap - date, debug - boot
表1-1 display info-center命令显示信息描述表
字段 |
描述 |
Information Center: |
信息中心的开启状态 |
Log host: |
日志主机的使用状态,包括日志主机的IP地址,所使用的通道号、通道名,语言及日志主机的级别 |
Console: |
控制口的使用状态,包括控制口所使用的通道号、通道名 |
Monitor: |
监视口的使用状态,包括监视口所使用的通道号、通道名 |
SNMP Agent: |
网管代理的使用状态,包括通道号、通道名 |
Log buffer: |
日志缓冲区的使用状态,包括使能态,最大容量,当前容量,当前信息数,通道名,通道号,已丢弃的信息数,被覆盖的信息数 |
Trap buffer: |
告警缓冲区的使用状态,包括使能态,最大容量,当前容量,当前信息数,通道名,通道号,已丢弃的信息数,被覆盖的信息数 |
Information timestamp setting: |
信息时间戳设置,分别说明日志信息、告警信息、调试信息的时间戳类型 |
【命令】
display logbuffer [ unit unit-id ] [ level severity | size buffersize ]* [ | { begin | exclude | include } regular-expression ]
【视图】
任意视图
【参数】
unit-id:设备的Unit的编号,取值为1。
level severity:显示指定严重等级的日志信息,severity取值范围1~8。
表1-2 信息中心定义的严重等级
严重等级 |
数值 |
描述 |
emergencies |
1 |
系统不可用信息 |
alerts |
2 |
需要立刻做出反应的信息 |
critical |
3 |
严重信息 |
errors |
4 |
错误信息 |
warnings |
5 |
警告信息 |
notifications |
6 |
正常出现但是重要的信息 |
informational |
7 |
需要记录的通知信息 |
debugging |
8 |
调试过程产生的信息 |
size buffersize:设置显示日志信息缓冲区的大小(可容纳消息的条数),buffersize取值范围1~1024,缺省值为512。
|:使用正则表达式过滤输出的日志信息。
begin:显示以指定文字开头的日志信息。
exclude:显示不含指定文字的日志信息。
include:显示包含指定文字的日志信息。
regular-expression:正则表达式。
【描述】
display logbuffer命令用来显示设备日志缓冲区的状态和缓冲区记录的日志信息。
【举例】
# 显示设备日志缓冲区的状态和缓冲区记录的日志信息。
<device> display logbuffer
Logging buffer configuration and contents:enabled
Allowed max buffer size : 1024
Actual buffer size : 512
Channel number : 4 , Channel name : logbuffer
Dropped messages : 0
Overwritten messages : 0
Current messages : 91
【命令】
display logbuffer summary [ level severity ]
【视图】
任意视图
【参数】
level severity:显示指定严重等级的日志信息统计数据,severity取值范围1~8。
【描述】
display logbuffer summary命令用来显示设备日志缓冲区的统计数据。
【举例】
# 显示设备日志缓冲区的概要信息。
<device> display logbuffer summary
EMERG ALERT CRIT ERROR WARN NOTIF INFO DEBUG
0 0 0 0 94 0 0 0
【命令】
display trapbuffer [ unit unit-id ] [ size buffersize ]
【视图】
任意视图
【参数】
unit-id:设备的Unit的编号,取值为1。
size buffersize:设置显示告警信息缓冲区的大小(可容纳消息的条数),buffersize取值范围1~1024,缺省值为256。
【描述】
display trapbuffer命令用来显示设备告警缓冲区的状态和缓冲区记录的告警信息。
如果输入size buffersize参数,设备将显示指定的最近记录的告警信息。
【举例】
# 显示设备告警缓冲区的状态和缓冲区记录的告警信息。
<device> display trapbuffer
Trapping Buffer Configuration and contents:enabled
Allowed max buffer size : 1024
Actual buffer size : 256
Channel number : 3 , Channel name : trapbuffer
Dropped messages : 0
Overwritten messages : 0
Current messages : 6
#Apr 1 23:55:52:263 2006 device L2INF/2/PORT LINK STATUS CHANGE:- 1 -
Trap 1.3.6.1.6.3.1.1.5.4(linkUp): portIndex is 4227641, ifAdminStatus is 1, ifOperStatus is 1
#Apr 2 00:17:47:875 2006 device L2INF/2/PORT LINK STATUS CHANGE:- 1 -
Trap 1.3.6.1.6.3.1.1.5.3(linkDown): portIndex is 4227833, ifAdminStatus is 2, ifOperStatus is 2
#Apr 4 02:39:37:645 2006 device ARP/5/DUPIP:- 1 -IP address 192.168.0.1 collision
detected, sourced by 000f-e200-0600 on GigabitEthernet1/0/43 of VLAN1 and 000c-760a-172d on GigabitEthernet1/0/43 of VLAN1
……
【命令】
info-center channel channel-number name channel-name
undo info-center channel channel-number
【视图】
系统视图
【参数】
channel-number:通道号,取值为0~9,即系统有10个通道。
channel-name:通道名,最长为30个字符,名称必须以英文字母开头,且只能包含英文字母和数字,不能使用特殊字符。
【描述】
info-center channel name命令用来将编号为channel-number的信息通道命名为channel-name。undo info-center channel命令用来恢复编号为channel-number的信息通道的缺省名称。
缺省情况下,通道0~9的名称分别为console,monitor,loghost,trapbuffer,logbuffer,snmpagent,channel6,channel7,channel8,channel9。
用户在命名时需要注意:信息通道不可重名。
【举例】
# 将0号通道命名为execconsole。
<device> system-view
System View: return to User View with Ctrl+Z.
[device] info-center channel 0 name execconsole
【命令】
info-center console channel { channel-number | channel-name }
undo info-center console channel
【视图】
系统视图
【参数】
channel-number:通道号,取值为0~9,即系统有10个通道。
channel-name:通道名。缺省情况下,通道0~9的名称分别为console,monitor,loghost,trapbuffer,logbuffer,snmpagent,channel6,channel7,channel8,channel9。
【描述】
info-center console channel命令用来设置向控制台输出信息的通道。undo info-center console channel命令用来恢复向控制台输出系统信息的缺省通道。
缺省情况下,设备向控制台输出系统信息,并使用0号(console)通道。
只有开启了信息中心功能,该命令才会生效。
相关配置可参考命令info-center enable,display info-center。
【举例】
# 设置向控制台输出信息的通道为0。
<device> system-view
System View: return to User View with Ctrl+Z.
[device] info-center console channel 0
【命令】
info-center enable
undo info-center enable
【视图】
系统视图
【参数】
无
【描述】
info-center enable命令用来开启信息中心功能。undo info-center enable命令用来关闭信息中心功能。
只有开启了信息中心功能,系统才会向日志主机、控制台等方向输出信息。
缺省情况下,信息中心功能处于开启状态。
相关配置可参考命令display info-center,info-center loghost ,info-center logbuffer,info-center console channel,info-center monitor channel,info-center trapbuffer,info-center snmp channel 。
【举例】
# 开启信息中心功能。
<device> system-view
System View: return to User View with Ctrl+Z.
[device] info-center enable
% Information center is enabled
【命令】
info-center logbuffer [ channel { channel-number | channel-name } | size buffersize ]*
undo info-center logbuffer [ channel | size ]
【视图】
系统视图
【参数】
channel:设置向日志缓冲区输出信息的通道。
channel-number:通道号,取值为0~9,即系统有10个通道。
channel-name:通道名。缺省情况下,通道0~9的名称分别为console,monitor,loghost,trapbuffer,logbuffer,snmpagent,channel6,channel7,channel8,channel9。
size buffersize:设置日志缓冲区的大小(可容纳消息的条数),buffersize取值范围0~1024,缺省值为512。
【描述】
info-center logbuffer命令用来设置向日志缓冲区输出信息。undo info-center logbuffer命令用来取消向日志缓冲区输出信息。
缺省情况下,设备向日志缓冲区输出信息,并使用4号(logbuffer)通道,日志缓冲区默认可以存储512条日志信息。
只有开启了信息中心功能,该命令才会生效。
相关配置可参考命令info-center enable,display info-center。
【举例】
# 设置系统向日志缓冲区发送日志信息,并设定日志缓冲区的大小为50。
<device> system-view
System View: return to User View with Ctrl+Z.
[device] info-center logbuffer size 50
【命令】
info-center loghost host-ip-addr [ channel { channel-number | channel-name } | facility local-number ]*
undo info-center loghost host-ip-addr
【视图】
系统视图
【参数】
host-ip-addr:日志主机的IP地址。
channel:设置日志主机的信息通道。
channel-number:通道号,取值为0~9,即系统有10个通道。
channel-name:通道名。缺省情况下,通道0~9的名称分别为console,monitor,loghost,trapbuffer,logbuffer,snmpagent,channel6,channel7,channel8,channel9。
facility:设置日志主机记录工具。
local-number:日志主机的记录工具,范围在local0~local7,缺省情况下为local7。
【描述】
info-center loghost命令用来设置向日志主机输出信息,通过设置日志主机的IP地址,可使信息向该方向输出。undo info-center loghost命令用来取消向日志主机输出信息。
只有开启了信息中心功能,该命令才会生效。
缺省情况下,设备不向日志主机输出信息。如果使能系统向日志主机输出信息,则系统默认使用2号(loghost)通道。
使用命令info-center loghost配置日志主机的IP地址时,请输入正确的IP地址。如果用户输入的是环回地址,系统将提示此地址无效。
相关配置可参考命令info-center enable,display info-center。
【举例】
# 设置系统向IP地址为202.38.160.1的Unix日志主机发送系统信息。
<device> system-view
System View: return to User View with Ctrl+Z.
[device] info-center loghost 202.38.160.1
【命令】
info-center loghost source interface-type interface-number
undo info-center loghost source
【视图】
系统视图
【参数】
interface-type:接口类型。
interface-number:接口编号。
【描述】
info-center loghost source命令用来设置向日志主机发送信息的源接口。undo info-center loghost source命令用来取消向日志主机发送信息的源接口的配置。
相关配置可参考命令info-center enable,display info-center。
【举例】
# 设置向日志主机发送信息的源接口为Vlan-interface 1。
<device> system-view
System View: return to User View with Ctrl+Z.
[device] info-center loghost source Vlan-interface 1
【命令】
info-center monitor channel { channel-number | channel-name }
undo info-center monitor channel
【视图】
系统视图
【参数】
channel-number:通道号,取值范围为0~9,即系统有10个通道。
channel-name:通道名。缺省情况下,通道0~9的名称分别为console,monitor,loghost,trapbuffer,logbuffer,snmpagent,channel6,channel7,channel8,channel9。
【描述】
info-center monitor channel命令用来设置向用户终端输出信息的通道。undo info-center monitor channel命令用来恢复向用户终端输出信息的通道为缺省值。
缺省情况下,设备向用户终端输出信息,并使用1号(monitor)通道。
只有开启了信息中心功能,该命令才会生效。
相关配置可参考命令info-center enable,display info-center。
【举例】
# 设置系统向用户终端输出信息的通道为0。
<device> system-view
System View: return to User View with Ctrl+Z.
[device] info-center monitor channel 0
【命令】
info-center snmp channel { channel-number | channel-name }
undo info-center snmp channel
【视图】
系统视图
【参数】
channel-number:通道号,取值范围为0~9,即系统有10个通道。
channel-name:通道名。缺省情况下,通道0~9的名称分别为console,monitor,loghost,trapbuffer,logbuffer,snmpagent,channel6,channel7,channel8,channel9。
【描述】
info-center snmp channel命令用来设置向SNMP Agent输出信息的通道。undo info-center snmp channel命令用来恢复向SNMP Agent输出信息的通道为缺省通道。
缺省情况下,设备向SNMP Agent输出信息,并使用5号(snmpagent)通道。
相关配置可参考命令snmp-agent,display info-center。
【举例】
# 设置设备使用6号通道向SNMP Agent输出信息。
<device> system-view
System View: return to User View with Ctrl+Z.
[device] info-center snmp channel 6
【命令】
info-center source { modu-name | default } channel { channel-number | channel-name } [ { log | trap | debug } { level severity | state state } ]*
undo info-center source { modu-name | default } channel { channel-number | channel-name }
【视图】
系统视图
【参数】
modu-name:模块名。
default:所有模块的缺省设置。
channel-number:信息输出的通道号。
channel-name:信息输出的通道名。缺省情况下,通道0~9的名称分别为console,monitor,loghost,trapbuffer,logbuffer,snmpagent,channel6,channel7,channel8,channel9。
log:日志信息。
trap:告警信息。
debug:调试信息。
level:级别。
severity:信息级别,参见表1-2。
state:设置信息状态。
state:取值为on和off。
【描述】
info-center source命令用来配置信息发送中的信息源和指定的输出方向。undo info-center source命令用来取消信息源和输出方向的配置。
该命令可以分别配置日志/告警/调试类型的过滤信息。例如可以将IP模块不同级别的信息输出到自定义的方向:高于warnings级别的日志信息输出到日志主机;高于informational的日志信息输出到日志缓冲区;同时将告警信息发送到日志主机。
info-center source命令利用通道名称或通道号确定各种信息的输出方向。目前,系统对每个输出方向分配一个缺省信息通道,如表1-3所示。
输出方向 |
信息通道名 |
控制台 |
console |
监视终端 |
monitor |
日志主机 |
loghost |
日志缓冲区 |
logbuffer |
告警缓冲区 |
trapbuffer |
SNMP |
snmpagent |
此外,对每个信息通道设有一条缺省记录,它的模块名为default,模块号为0xffff0000,但对于不同信息通道,此记录对日志、告警、调试类信息的缺省设置值可能不同。当某一个模块在此通道中没有明确的配置记录时,系统使用这条缺省的配置记录。
【举例】
# 设置将snmp通道中的VLAN模块的日志类信息打开,且允许输出信息的最低级别为emergencies。
<device> system-view
System View: return to User View with Ctrl+Z.
[device] info-center source vlan channel snmpagent log level emergencies
【命令】
info-center synchronous
undo info-center synchronous
【视图】
系统视图
【参数】
无
【描述】
info-center synchronous命令用来开启同步信息输出功能。开启该功能后,若在用户输入时有日志等系统信息输出,则在输出后回显命令行提示符(在命令编辑状态回显提示符,交互状态不回显)和用户已有的输入。undo info-center synchronous用来关闭同步信息输出功能。
缺省情况下,同步信息输出功能处于关闭状态。
l 可以使用info-center synchronous命令实现同步信息输出功能。此功能用于用户在进行操作(操作还没有完成)却被大量的系统信息打断时,回显用户的上一步操作,用户可以接着执行上一步的操作。
l 在收集调试信息的时候,使用info-center synchronous命令可能导致每条调试信息之后都会回显一行命令行提示符,增加了不必要信息的输出,此时建议关闭此功能。
【举例】
# 打开同步信息输出功能
<device> system-view
System View: return to User View with Ctrl+Z.
[device] info-center synchronous
Current IC terminal output sync is on
【命令】
info-center timestamp { log | trap | debugging } { boot | date | none }
undo info-center timestamp { log | trap | debugging }
【视图】
系统视图
【参数】
log:日志信息。
trap:告警信息。
debugging:调试信息。
boot:系统启动后经过时间,格式为:xxxxxx.yyyyyy,其中xxxxxx是系统自启动后经历时间的毫秒数高32位,yyyyyy是低32位。
date:系统当前日期和时间,格式为:Mmm dd hh:mm:ss:ms yyyy。
none:输出的信息中不包含时间戳信息。
【描述】
info-center timestamp命令用来设置输出的日志/告警 /调试信息中的时间戳格式。undo info-center timestamp命令用来恢复缺省设置。
缺省情况下,日志和告警信息使用date时间戳,调试信息使用boot时间戳。
【举例】
# 设置调试信息时间戳格式为boot格式。
<device> system-view
System View: return to User View with Ctrl+Z.
[device] info-center timestamp debugging boot
【命令】
info-center timestamp loghost { date | no-year-date | none }
undo info-center timestamp loghost
【视图】
系统视图
【参数】
date:系统当前日期和时间,格式为:Mmm dd hh:mm:ss:ms yyyy。
no-year-date:不包含年份信息的系统当前日期和时间,格式为:Mmm dd hh:mm:ss:ms。
none:输出的信息中不包含时间戳信息。
【描述】
info-center timestamp loghost命令用来设置发往日志主机的时间戳输出格式。undo info-center timestamp loghost命令用来恢复系统的缺省设置。
缺省情况下,使用date时间戳。
【举例】
# 设置发往日志主机的时间戳为不包含年份的格式。
<device> system-view
System View: return to User View with Ctrl+Z.
[device] info-center timestamp loghost no-year-date
【命令】
info-center timestamp utc
undo info-center timestamp utc
【视图】
系统视图
【参数】
无
【描述】
info-center timestamp utc命令用来配置在信息中心各输出方向输出的date类型时间戳中增加UTC时区信息。undo info-center timestamp utc命令用来恢复缺省情况。
缺省情况下,信息中心各输出方向输出的date类型时间戳中不包含UTC时区信息。
相关配置可参考命令display info-center,info-center timestamp,info-center timestamp loghost,clock timezone。
【举例】
# 配置信息中心输出信息中显示UTC时间。
<device> system-view
System View: return to User View with Ctrl+Z.
[device] info-center timestamp utc
# 显示信息中心时间戳配置情况。
[device] display info-center
Information Center: enabled
……
Information timestamp setting:
with utc
log - date, trap - date, debug - boot
# 配置信息中心输出信息中显示UTC时间功能后,输出系统信息如下所示。
%Dec 8 10:12:21:708 2006 [GMT+08:00:00] device SHELL/5/LOGIN:- 1 - VTY(1.1.0.2) in unit1 login
【命令】
info-center trapbuffer [ channel { channel-number | channel-name } | size buffersize ]*
undo info-center trapbuffer [ channel | size ]
【视图】
系统视图
【参数】
size:设置告警缓冲区的大小。
buffersize:告警缓冲区的大小(可容纳消息的条数),取值范围0~1024,缺省值256。
channel:设置向告警缓冲区输出信息的通道。
channel-number:通道号,取值范围为0~9,即系统有10个通道。
channel-name:通道名。缺省情况下,通道0~9的名称分别为console,monitor,loghost,trapbuffer,logbuffer,snmpagent,channel6,channel7,channel8,channel9。
【描述】
info-center trapbuffer命令用来设置向告警缓冲区输出信息。undo info-center trapbuffer 命令用来取消向告警缓冲区输出信息。
缺省情况下,系统向告警缓冲区输出信息,并使用3号(trapbuffer)通道,缓冲区可存储256条信息。
只有开启了信息中心功能,该命令才会生效。
相关配置可参考命令info-center enable,display info-center。
【举例】
# 设置系统向告警缓冲区发送告警信息,并设定告警缓冲区的大小为30。
<device> system-view
System View: return to User View with Ctrl+Z.
[device] info-center trapbuffer size 30
【命令】
reset logbuffer [ unit unit-id ]
【视图】
用户视图
【参数】
unit-id:设备的Unit的编号,取值为1。
【描述】
reset logbuffer命令用来清除日志缓冲区内的信息。
【举例】
# 清除日志缓冲区中的信息。
<device> reset logbuffer
【命令】
reset trapbuffer [ unit unit-id ]
【视图】
用户视图
【参数】
unit-id:设备的Unit的编号,取值为1。
【描述】
reset trapbuffer命令用来清除告警缓冲区内的信息。
【举例】
# 清除告警缓冲区中的信息。
<device> reset trapbuffer
【命令】
terminal debugging
undo terminal debugging
【视图】
用户视图
【参数】
无
【描述】
terminal debugging命令用来开启显示调试信息功能。undo terminal debugging命令用来关闭显示调试信息功能。
缺省情况下,系统关闭显示功能。
如果用户需要在终端上显示调试信息,可以执行terminal debugging命令。
相关配置可参考“系统维护与调试”部分的debugging命令。
【举例】
# 开启终端显示调试信息功能。
<device> terminal debugging
【命令】
terminal logging
undo terminal logging
【视图】
用户视图
【参数】
无
【描述】
terminal logging命令用来开启日志信息显示功能。undo terminal logging命令用来关闭显示日志信息功能。
缺省情况下,控制台用户和终端用户都开启日志信息显示功能。
【举例】
# 关闭终端日志显示功能。
<device> undo terminal logging
【命令】
terminal monitor
undo terminal monitor
【视图】
用户视图
【参数】
无
【描述】
terminal monitor命令用来开启调试/日志/告警信息显示功能。undo terminal monitor命令用来关闭上述信息的显示功能。
缺省情况下,控制台用户和终端用户都开启调试/日志/告警信息显示功能。
此命令只影响输入命令的当前终端,只有在用户视图执行了本命令,调试/日志/告警信息才有可能输出到当前终端。
l 在terminal monitor为关闭的情况下,相当于执行undo terminal debugging,undo terminal logging,undo terminal trapping 命令,所有的调试/日志/告警信息在本终端都不显示;
l 在terminal monitor为开启的情况下,可以分别使用terminal debugging/undo terminal debugging,terminal logging/undo terminal logging,terminal trapping/undo terminal trapping打开或关闭调试/日志/告警信息。
【举例】
# 关闭终端显示功能。
<device> undo terminal monitor
【命令】
terminal trapping
undo terminal trapping
【视图】
用户视图
【参数】
无
【描述】
terminal trapping命令用来开启告警信息显示功能。undo terminal trapping命令用来关闭终端显示告警信息功能。
缺省情况下,系统开启告警信息显示功能。
【举例】
# 开启告警信息显示功能。
不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!