向不同的日志主机和终端输出不同的信息
应用环境
当路由器在运行过程中,特别是处于调试阶段时,可能不同的网络管理员需要同时观察不同模块的运行状态。因此,要求能向不同的日志主机和终端输出不同类型、级别和模块的信息。
配置思路
采用如下的思路配置本举例:
1. 使能信息中心。
2. 配置loghost信息通道,保证路由器能正确的向日志主机发送RPR模块的调试信息、日志信息和告警信息。同时,关闭其它模块向日志主机输出调试信息、日志信息和告警信息的开关。
3. 配置console信息通道,保证路由器能正确的向Console终端发送FTP服务器模块的调试信息、日志信息和告警信息。同时,关闭其它模块向Console终端输出调试信息、日志信息和告警信息的开关。
4. 打开RPR模块和FTP服务器模块的调试信息开关。
5. 打开Console终端的屏幕显示开关。
6. 配置日志主机。
配置注意事项
输出信息的接口必须是三层接口,且可以配置IP地址。
配置实例
组网需求
说明
当路由器处于实际运行过程中,如无特殊需求,应及时关闭已经打开的调试开关,以免影响路由器的性能。
如下图所示,路由器上的GE1/0/0接口与日志主机之间有可达路由。
下图中的路由器处于调试阶段,网络管理员需要长时间监控和调试RPR模块。此时,可以将RPR模块的调试信息、日志信息和告警信息都输出到日志主机,以便网络管理根据保存在日志主机上的信息分析RPR模块的运行状态。
同时,网络管理员怀疑路由器的FTP服务器模块出现故障,需要调试此模块,并查看此模块的调试信息、日志信息和告警信息。假设网络管理员通过Console口登录路由器,则需要向Console终端输出FTP服务器模块的调试信息、日志信息和告警信息。为避免干扰,需要禁止其它模块向Console终端输出调试信息、日志信息和告警信息。
适用产品和版本
适用于NE40E/NE80E设备,版本为(VRP5.30_31)及后续版本。
适用于NE5000E设备,版本为(VRP5.30_22)及后续版本。
配置步骤
说明
配置举例中,只列出了与监控、调试相关的命令。日志主机侧的配置请参考日志主机的帮助文件。
步骤 1 使能信息中心。
# 使能信息中心。缺省情况下,路由器的信息中心处于使能状态。
<Quidway> system-view
[Quidway] info-center enable
Info:Information center is enabled
步骤 2 向日志主机输出信息。
# 配置loghost信息通道,使路由器向日志主机输出RPR模块的日志信息、告警信息和调试信息,输出的信息严重等级都是0~7级。
[Quidway] info-center source rpr channel loghost debug state on level debugging log state on level debugging trap state on level debugging
# 关闭loghost信息通道中其它模块的日志信息、告警信息和调试信息的输出开关。
[Quidway] undo info-center source default channel loghost
# 检查配置结果。
[Quidway] display channel loghost
channel number:2, channel name:loghost
MODU_ID NAME ENABLE LOG_LEVEL ENABLE TRAP_LEVEL ENABLE DEBUG_LEVEL
5200000 RPR Y debugging Y debugging Y debugging
步骤 3 向Console终端输出信息。
# 配置console信息通道,使路由器向日志主机输出FTP服务器模块的日志信息、告警信息和调试信息,输出的信息严重等级都是0~7级。
[Quidway] info-center source ftps channel console debug state on level debugging log state on level debugging trap state on level debugging
# 关闭console信息通道中其它模块的日志信息、告警信息和调试信息的输出开关。
[Quidway] undo info-center source default channel console
# 检查配置结果。
[Quidway] display channel console
channel number:0, channel name:console
MODU_ID NAME ENABLE LOG_LEVEL ENABLE TRAP_LEVEL ENABLE DEBUG_LEVEL
1880000 FTPS Y debugging Y debugging Y debugging
步骤 4 打开调试信息开关。
# 打开RPR模块的所有调试信息开关。
[Quidway] quit
<Quidway> debugging rpr all
# 打开FTP服务器模块的调试信息开关。
<Quidway> debugging ftp-server
# 检查配置结果。
<Quidway> display debugging
All RPR global debugging switch is on
Ftp server Debugging is on
步骤 5 在路由器上配置日志主机的IP地址和输出信息的接口。
# 配置日志主机的IP地址是1.0.0.2。
<Quidway> system-view
[Quidway] info-center loghost 1.0.0.2
# 配置路由器上向日志主机输出信息的接口是GE1/0/0。
[Quidway] info-center loghost source gigabitethernet 1/0/0
# 检查配置结果。
[Quidway] display info-center
Information Center:enabled
Log host:
the interface name of the source address: GigabitEthernet1/0/0
1.0.0.2, channel number 2, channel name loghost,
language english , host facility local7
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 440, channel number : 4, channel name : logbuffer
dropped messages 0, overwritten messages 0
Trap buffer:
enabled,max buffer size 1024, current buffer size 256,
current messages 1, channel number:3, channel name:trapbuffer
dropped messages 0, overwritten messages 0
logfile:
channel number : 9, channel name : channel9, language : english
Information timestamp setting:
log - date, trap - date, debug - boot
Sent messages = 499, Received messages = 499
IO Reg messages = 0 IO Sent messages = 0
步骤 6 打开Console终端的屏幕显示开关
# 打开Console终端的屏幕显示开关。根据需要查看的信息类型,打开相应的屏幕显示开关。缺省情况下,Console终端的terminal monitor开关和terminal logging开关处于打开状态。
[Quidway] info-center console channel 0
[Quidway] quit
<Quidway> terminal monitor
Info:Current terminal monitor is on
<Quidway> terminal debugging
Info:Current terminal debugging is on
<Quidway> terminal logging
Info:Current terminal logging is on
<Quidway> terminal trapping
Info:Current terminal trapping is on
配置文件
#
sysname Quidway
#
info-center source FTPS channel 0 log level debugging trap level debugging debug state on
undo info-center source default channel 0
info-center source RPR channel 2 log level debugging trap level debugging debug state on
undo info-center source default channel 2
info-center loghost source GigabitEthernet1/0/0
info-center loghost 1.0.0.2
#
return
|
|
||
|
|
||
|
|
7月26 |
H3CNE认证 |
热报中 |
8月16 |
H3C-IMC认证 |
热报中 |
7月26 |
H3CNE认证 |
热报中 |
7月26 |
H3CIE+认证 |
热报中 |
8月16 |
H3C-IMC认证 |
热报中 |
7月26 |
H3CNE培训 |
热报中 |
7月26 |
H3CSE认证 |
热报中 |
8月16 |
H3C无线 |
热报中 |
7月26 |
H3CSE培训 |
热报中 |
8月16 |
H3CIMC培训 |
热报中 |
8月16 |
H3C无线培训 |
热报中 |
8月31 |
H3CEAD培训 |
热报中 |
8月16 |
H3CPME认证 |
热报中 |
8月16 |
H3C安全认证 |
热报中 |
8月16 |
H3CIMC培训 |
热报中 |
8月16 |
H3C无线培训 |
热报中 |
8月09 |
H3CEAD培训 |
热报中 |
8月16 |
H3CPME认证 |
热报中 |
8月16 |
H3C安全认证 |
热报中 |
8月16 |
H3CIMC培训 |
热报中 |
8月09 |
H3C无线培训 |
热报中 |
8月09 |
H3CEAD培训 |
热报中 |
8月09 |
H3CPME认证 |
热报中 |
8月09 |
H3C安全认证 |
热报中 |