在GSR的line-Card上配置Core Dump
exception suffix slot-number
exception linecard slot 6
exception
linecard slot 6 core-file router_slot6_core
exception linecard slot 6
main-memory 16 Mbytes
ip ftp username test
ip ftp password blahtest*
ip ftp source-interface
Ethernet 0
no ip ftp passive
=====================================#
exception core-file router-core
-
对路由器崩溃时所生成的core-file设置文件名,并创建核心文件。可将core-file的名称设置为[hostname]-core,这样,每个路由器本身都具有唯一的core-file。
示例:若路由器的主机名是"itaa",则应输入"exception core-file
itaa-core"这样的命令。当然,命名规则纯属个人行为,你完全可以采用自我感觉良好的命名方式对配置文件进行命名,就如 TFTP配置备份原理一样。
# exception protocol ftp
- 设置使用该协议将核心文件写入远端主机中。这里的协议可以是文件传输协议(FTP)、小文件传输协议(TFTP)或远程复制协议
(RCP)。这里有两个小地方应该注意一下:
- 1. 不可将TFTP用来转储大于16 MB的核心文件。
- 2.
如果使用FTP,系统上必须有有效的用户帐户,另外由于核心文件的尺寸很大,所以必须拥有足够的空闲磁盘空间。
# exception dump 199.171.28.31
- 设置远端主机的IP地址或主机名称,核心文件将被写入到远端主机当中。
# exception crashinfo
- 配置路由器写入crashinfo文件。
-
默认位置为bootflash:crashinfo_"datetime of crash"
(使用"exception crashinfo
file"device:filename"' 来进行配置)。
- 默认大小为32 KB
(最大值为100 KB,使用"exception
crashinfo buffer 100"' 来进行配置)。
# exception suffix slot-number
- 如果LC
core-file没有明确的文件名,则通过此命令将插槽编号附加到核心文件名上。
# exception linecard slot 6
-当插槽6中的LC崩溃时,通过此命令可启用写入core-file功能。
# exception linecard slot 6 core-file router_slot6_core
-
对插槽6中的LC所生成的核心文件设置文件名。
# exception linecard slot 6 main-memory 16 Mbytes
-
在生成核心文件的情况下,设置要转储的主存储器内容的数量。通常可对其进行配置以转储主存储器的全部内容。注:
- 最大值为256
Mbytes,因此,一般而言,这个值的设置是安全的。此外,若规定了 "exception linecard slot 6 main-memory 256
M",则在配置中不会出现它。这是因为,如果为LC启用核心文件生成功能,它是默认的配置。
# ip ftp username test
- 通过FTP将核心文件加载到远端服务器时所使用的用户名。
# ip ftp password blah
- 上面所设用户名的口令。
# ip ftp source-interface Ethernet 0
- 寻找FTP连接源的接口。
# no ip ftp passive
- 在默认情况下,路由器设法通过PASS(无源)模式FTP来进行连接。通过 no ip ftp
passive 命令可关闭这种功能。 测试配置
对路由器进行配置以执行Core Dump,则有必要对设置进行测试。可以连接到LC上,并进行 "test
crash"。然后键入"C",并选择崩溃原因。IOS在特权EXEC模式(启用模式)下提供以下特殊隐藏命令,以便对核心转储 进行测试或触发:itaa#attach
6!-- 其中6是你想测试的核心的LC插槽号
Entering Console for 4 Port Packet Over SONET
OC-12c/STM-4 in Slot: 6
Type "exit" to end this session
Press RETURN to get started!
LC-Slot6>enable
LC-Slot6#test crash
WARNING: Command selections
marked with '(crash router)' will crash
router when issued. However a
selection 'C' will need to
be issued IMMEDIATELY before these selections to
enable them.
Type the number for the selected
crash:
--------------------------------------
1 (crash router) Bus Error,
due to invalid address access
2 (crash router) Bus Error, due to parity error
in Main memory
3 (crash router) Bus Error, due to parity error in I/O
memory
4 (crash router) Address Error, due to fetching code from odd
address
5 (crash router) Jump to zero
6 (crash router) Software forced
crash
7 (crash router) Illegal read of address zero
8 (crash router)
Divide by zero
9 (crash router) Corrupt memory
C Enable crash router
selection marked with (crash router)
U (crash router) User enter write bus
error address
W (crash router) Software watchdog timeout (*** Watch Dog
Timeout ***)
w (crash router) Process watchdog timeout (SYS-2-WATCHDOG)
x
Exit crash menu 此命令将引起崩溃,并相应地将路由器存储器的内容进行转储。若未生成核心转储,则必须检查整个设置和配置。test
crash命令将中断处于运行状态的网络,使路由器崩溃,并在路由器存储器内容转储之前,防止路由器重新运行。此过程所需要的时
间取决于RP或LC上存在的动态RAM(DRAM)的容量。