Creating Exception Dump Files

Creating Exception Dump Files

Problem

Your router is having serious problems and you need to create an exception dump to forward to Cisco's TAC.

Solution

To create an exception dump of a router's memory after a failure, you need to configure the exception dump command, as well as telling the router how automatically transfer this information to a server:

Router1#configure terminal 
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#ip ftp source-interface Loopback0
Router1(config)#ip ftp username ijbrown
Router1(config)#ip ftp password ijpassword
Router1(config)#exception protocol ftp
Router1(config)#exception region-size 65536
Router1(config)#exception dump 172.25.1.3
Router1(config)#end
Router1#

Discussion

This is the one recipe in this book that we hope none of our readers ever need to use. The main reason for creating an exception dump of your router memory contents is to help Cisco's TAC in diagnosing catastrophic software problems with one of your routers. When you have these types of extreme problems, however, the TAC will often ask to do an exception dump on the router. So we have included this recipe so that you'll know what to do if it ever becomes necessary.

An exception dump is a snapshot of the router's memory contents taken just before a software error forces the router to reload. The router has to transfer this information to a server because it is too much information to store in nonvolatile storage.

The dump actually creates two files, one of the main system memory and one of the IO memory. The software engineers at Cisco can then use these two files to figure out what caused the software failure and hopefully create a fix for the next IOS release.

By default, the router will use TFTP to transfer the dump files. However, we strongly recommend using FTP instead. If your router has more than 16 MB of memory, most TFTP applications will fail, so FTP is the only option. FTP is much more reliable than TFTP, and you don't want to have to repeat the process if the TAC tells you that the file was corrupted during transfer. Our example shows how to configure a router to use FTP to transfer the exception dump files from the router to the server. For more information on configuring the router to use FTP, please see Recipe 1.14.

Exception dumps are prone to fail because the router doesn't attempt them until it has suffered a serious software failure. This software failure could corrupt your router's memory, making any further processing impossible, even creating the exception dump. You can greatly increase the chances of a successful exception dump by dedicating a small amount of memory to serve as a backup memory pool in case the main memory becomes corrupted:

Router1#configure terminal 
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#exception region-size 65536
Router1(config)#end
Router1#

You can define how much memory the router should dedicate to creating exception dumps. The default is 16,384 bytes, but we recommend increasing this to the maximum value of 65,536 bytes. This will greatly increase the chances of a successful exception dump.

By default, the router creates two exception dump files named hostname-core and hostname-coreiomem. In our example, the router name is Router1, so the two files created will be called Router1-core and Router1-coreiomem. You can change the default naming convention of the core files with the exception core-file command:

Router1#configure terminal 
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#exception core-file router5 compress
Router1(config)#end
Router1#

You will notice that we have included the optional keyword called compress in this command. This option instructs the router to compress the core files before transferring them to the server. You can then uncompress the files on the server with the Unix uncompress command. We actually don't recommend using this feature, though, because it adds an extra CPU and memory load to a router that is already in trouble. Furthermore, we have found that this option doesn't seem to shrink the files enough to be useful. In some cases, it even causes the main core file to grow larger.

On the server side, you need to ensure that you have enough disk space to hold the two dump files. The size of these files will vary from router to router, depending on the amount of memory they contain. Expect the dump files to equal the total amount of memory installed in the router.

You can force the router to perform a core dump of its normal memory with the write core command. This command provides an excellent way to test whether everything is configured correctly before a catastrophic failure forces the real dump:

Router1#write core
Remote host [172.25.1.3]?
Base name of core files to write [Router1-core]?
Writing Router1-coreiomem !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Writing Router1-core !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Router1#

When we display these files on the server, you can see that their combined sizes are 48 MB:

Freebsd% ls -la
drwxr-xr-x 3 ijbrown ijbrown 512 Feb 1 13:50 ./
drwxr-xr-x 5 root wheel 512 Feb 4 2002 ../
-rw-r--r-- 1 ijbrown ijbrown 46137344 Feb 1 13:54 Router1-core
-rw-r--r-- 1 ijbrown ijbrown 4194304 Feb 1 13:52 Router1-coreiomem
Freebsd%

To increase the chances of success, use a server that is as close as possible to the router. Time is of the essence during the creation of an exception dump, so forcing a router to write its core across a slow and congested WAN link decreases your chances of success.

See Also