Logging to the flash

October 26, 2008 at 10:25 pm | Posted in System Management | 1 Comment

To store logging to a file under a folder in the flash, we need first create folder, then configure router to log to a file under that folder. As for a lab purpose, do not forget to delete the file & folder after your task, unless you want to have your flash to serve as a rubbish bin.

Create folder

Rack1SW1#mkdir flash:/var
Create directory filename [var]?
Created dir flash:/var
Rack1SW1#mkdir flash:/var/log
Create directory filename [/var/log]?
Created dir flash:/var/log

Router configuration

Rack1SW1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Rack1SW1(config)#logging file flash:/var/log/syslog 32768 informational
Rack1SW1(config)#exit
Rack1SW1#con
*Mar  1 01:00:05.834: %SYS-5-CONFIG_I: Configured from console by console
Rack1SW1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Rack1SW1(config)#exit
Rack1SW1#
Rack1SW1#

Verification

Rack1SW1#sh log
Syslog logging: enabled (0 messages dropped, 0 messages rate-limited, 0 flushes, 0 overruns, xml disabled, filtering disabled)

No Active Message Discriminator.

No Inactive Message Discriminator.

    Console logging: level debugging, 123 messages logged, xml disabled,
                     filtering disabled
    Monitor logging: level debugging, 0 messages logged, xml disabled,
                     filtering disabled
    Buffer logging:  level debugging, 123 messages logged, xml disabled,
                    filtering disabled
    Exception Logging: size (4096 bytes)
    Count and timestamp logging messages: disabled
    File logging: file flash:/var/log/syslog,
        max size 32768, min size 0,
        level informational, 7 messages logged
    Persistent logging: disabled
    Trap logging: level informational, 126 message lines logged

Log Buffer (4096 bytes):

*Mar  1 01:00:05.834: %SYS-5-CONFIG_I: Configured from console by console
*Mar  1 01:00:09.383: %SYS-5-CONFIG_I: Configured from console by console

Rack1SW1#more flash:/var/log/syslog
*Mar  1 01:00:05.834: %SYS-5-CONFIG_I: Configured from console by console
*Mar  1 01:00:09.383: %SYS-5-CONFIG_I: Configured from console by console
Rack1SW1#dir flash:/var/log
Directory of flash:/var/log/

   17  -rwx         148   Mar 1 1993 01:00:10 +00:00  syslog

15998976 bytes total (5516288 bytes free)

Rack1SW1#dir flash:
Directory of flash:/

    2  -rwx        2969   Mar 1 1993 00:57:36 +00:00  vol1-v5-ipservices
    3  -rwx    10410401   Mar 1 1993 01:46:49 +00:00  c3560-advipservicesk9-mz.122-44.SE1.bin
    4  -rwx        1931   Mar 1 1993 01:35:16 +00:00  initial-cfg
    5  -rwx        1216   Mar 1 1993 00:00:42 +00:00  vlan.dat
    6  -rwx        1048   Mar 1 1993 14:23:22 +00:00  multiple-fs
    7  -rwx        2054   Mar 1 1993 00:31:09 +00:00  vol1-v4-nat-common
    8  -rwx        3473   Mar 1 1993 00:01:34 +00:00  vol2-lab13
    9  -rwx       40815   Mar 1 1993 00:03:14 +00:00  log.txt
   10  -rwx        2987   Mar 1 1993 14:20:59 +00:00  config.text
   11  -rwx        2800   Mar 1 1993 00:38:28 +00:00  vol1-v5-ospf
   12  -rwx        2687   Mar 1 1993 00:02:25 +00:00  vol2-lab14
   13  -rwx        1934   Mar 1 1993 14:20:59 +00:00  private-config.text
   14  -rwx        2987   Mar 1 1993 14:25:43 +00:00  vol1-v5-system-management
   15  drwx          64   Mar 1 1993 00:59:30 +00:00  var

15998976 bytes total (5516288 bytes free)

Delete files & folders on flash

Rack1SW1#delete flash:/var
Delete filename [var]?
Delete flash:/var? [confirm]
%Error deleting flash:/var (Is a directory)

Rack1SW1#delete /recursive flash:/var
Delete filename [var]?
Examine files in directory flash:/var? [confirm]
Examine files in directory flash:/var/log? [confirm]
Delete flash:/var/log/syslog? [confirm]
Delete flash:/var/log? [confirm]
Delete flash:/var? [confirm]
Rack1SW1#
Advertisements

1 Comment »

RSS feed for comments on this post. TrackBack URI


Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.
Entries and comments feeds.

%d bloggers like this: