How do I detect router restarts?

Mike Nipp has wondered which syslog message to use to reliably detect router reload under all circumstances:

The problem I had with the SYS-5-RESTART message is I don't think you will get one if the power is suddenly pulled from the router. It does do a SNMP-5-COLDSTART and SYS-6-BOOTTIME on boot up.

I did an actual power-cycle test of a router (we can do that remotely in our labs, so I didn't have to touch the box :) and the SYS-5-RESTART message is reliably generated at every startup, be it from the power cycle or the reload command (I was not able to provoke an on-demand crash ;).

This article is part of You've asked for it series.

4 comments:

  1. Perhaps test crash command could be accurate for your tests if it haven't his own syslog messages.

    ReplyDelete
  2. Have you tried the core dump?

    http://www.cisco.com/warp/public/112/appA.htm

    ReplyDelete
  3. I think what fropert was referencing was the undocumented "test crash" IOS cli command...


    T1Router#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)
    R (crash router) User enter read bus error address
    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)
    d Disable crashinfo collection
    e Enable crashinfo collection
    i Display contents of current crashinfo flash file
    m Write crashinfo on crashinfo RAM
    n Change crashinfo flash file name
    q Exit crash menu
    s Save crashinfo to current crashinfo flash file
    c Close current crashinfo flash file
    t Write crashinfo on console TTY
    x Exit crash menu
    ?



    T1Router uptime is 31 minutes
    System returned to ROM by error - a Software forced crash, PC 0x80204EEC at 04:46:03 UTC Thu Apr 28 2005

    ReplyDelete
  4. Another option is to use the @reboot cron specification with a cron timer EEM policy.

    ReplyDelete

You don't have to log in to post a comment, but please do provide your real name/URL. Anonymous comments might get deleted.

Ivan Pepelnjak, CCIE#1354, is the chief technology advisor for NIL Data Communications. He has been designing and implementing large-scale data communications networks as well as teaching and writing books about advanced technologies since 1990. See his full profile, contact him or follow @ioshints on Twitter.