- Index
- Preface
- Product Overview
-
- Configuring Ethernet Interfaces
- Configuring VLANs
- Configuring Private VLANs
- Configuring Rapid PVST+
- Configuring Multiple Spanning Tree
- Configuring STP Extensions
- Configuring Port Channels
- Configuring Access and Trunk Interfaces
- Configuring the MAC Address Table
- Configuring IGMP Snooping
- Configuring Traffic Storm Control
-
- Configuring Fibre Channel Interfaces
- Configuring Domain Parameters
- Configuring N-Port Virtualization
- Configuring VSAN Trunking
- Configuring SAN PortChannels
- Configuring and Managing VSANs
- Configuring and Managing Zones
- Distributing Device Alias Services
- Configuring Fibre Channel Routing Services and Protocols
- Managing FLOGI, Name Server, FDMI, and RSCN Databases
- Discovering SCSI Targets
- Advanced Features and Concepts
- Configuring FC-SP and DHCHAP
- Configuring Port Security
- Configuring Fabric Binding
- Configuring Fabric Configuration Servers
- Configuring Port Tracking
Configuring System Message Logging
This chapter describes how to configure system message logging on the switch.
Information About System Message Logging
You can use system message logging to control the destination and to filter the severity level of messages that system processes generate. You can configure logging to terminal sessions, a log file, and syslog servers on remote systems.
By default, the switch outputs messages to terminal sessions. For information about configuring logging to terminal sessions, see the “Configuring System Message Logging to Terminal Sessions” section.
By default, the switch logs system messages to a log file. For information about configuring logging to a file, see the “Configuring System Message Logging to a File” section.
Table 1-1 describes the severity levels used in system messages. When you configure the severity level, the system outputs messages at that level and lower.
|
|
---|---|
The switch logs the most recent 100 messages of severity 0, 1, or 2 to the NVRAM log. You cannot configure logging to the NVRAM.
You can configure which system messages should be logged based on the facility that generated the message and its severity level. For information about configuring the severity level by module and facility, see the “Configuring Module and Facility Messages Logged” section.
syslog Servers
syslog servers run on remote systems that are configured to log system messages based on the syslog protocol. You can configure up to three syslog servers. For information about configuring syslog servers, see the “Configuring syslog Servers” section.
To support the same configuration of syslog servers on all switches in a fabric, you can use the Cisco Fabric Services (CFS) to distribute the syslog server configuration. For information about distributing the syslog server configuration, see the “Configuring syslog Server Configuration Distribution” section.
Note When the switch first initializes, messages are sent to syslog servers only after the network is initialized.
Configuring System Message Logging
This section includes the following topics:
- Configuring System Message Logging to Terminal Sessions
- Configuring System Message Logging to a File
- Configuring Module and Facility Messages Logged
- Configuring syslog Servers
- Configuring syslog Server Configuration Distribution
- Displaying and Clearing Log Files
Note If you are familiar with the Cisco IOS CLI, be aware that the Cisco NX-OS commands for this feature might differ from the Cisco IOS commands that you would use.
Configuring System Message Logging to Terminal Sessions
You can configure the switch to log messages by their severity level to console, Telnet, and SSH sessions.
By default, logging is enabled for terminal sessions. To configure the switch to log messages, perform this task:
|
|
|
---|---|---|
Enables the switch to log messages to the console session based on a specified severity level or higher. Severity levels, which can range from 0 to 7, are listed in Table 1-1 . If the severity level is not specified, the default of 2 is used. |
||
Disables the switch’s ability to log messages to the console. |
||
Enables the switch to log messages to the monitor based on a specified severity level or higher. The configuration applies to Telnet and SSH sessions. Severity levels, which can range from 0 to 7, are listed in Table 1-1 . If the severity level is not specified, the default of 2 is used. |
||
(Optional) Copies the running configuration to the startup configuration. |
The following example shows how to configure a switch to log messages:
switch(config)# logging console 3
switch(config)# no logging console
switch(config)# show logging console
switch(config)# logging monitor 3
switch(config)# no logging monitor
Configuring System Message Logging to a File
You can configure the switch to log system messages to a file. By default, system messages are logged to the file log:messages.
For information about displaying and clearing log files, see the “Displaying and Clearing Log Files” section.
To configure the switch to log system messages to a file, perform this task:
|
|
|
---|---|---|
switch(config)# logging logfile logfile-name severity-level [ size bytes ] |
Configures the name of the log file used to store system messages and the minimum severity level to log. You can optionally specify a maximum file size. The default severity level is 5 and the file size is 10485760. Severity levels are listed in Table 1-1 . The file size is from 4096 to 10485760 bytes. |
|
switch(config)# no logging logfile [ logfile-name severity-level [ size bytes ]] |
||
(Optional) Copies the running configuration to the startup configuration. |
The following example shows how to configure a switch to log system messages to a file:
switch(config)# logging logfile my_log size 6
switch(config)# no logging logfile
Configuring Module and Facility Messages Logged
To configure the severity level and time-stamp units of messages logged by modules and facilities, perform this task:
|
|
|
---|---|---|
Enables module log messages that have the specified severity level or higher. Severity levels, which range from 0 to 7, are listed in Table 1-1 . If the severity level is not specified, the default of 5 is used. |
||
Enables logging messages from the specified facility that have the specified severity level or higher. Severity levels, which range from 0 to 7, are listed in Table 1-1 . To apply the same severity level to all facilities, use the all facility. For defaults, see the show logging level command. |
||
switch(config)# no logging level [ facility severity-level ] |
Resets the logging severity level for the specified facility to its default level. If you do not specify a facility and severity level, the switch resets all facilities to their default levels. |
|
(Optional) Displays the logging level configuration and the system default level by facility. If you do not specify a facility, the switch displays levels for all facilities. |
||
switch(config)# logging timestamp { microseconds | milliseconds | seconds } |
Sets the logging time-stamp units. By default, the units are seconds. |
|
switch(config)# no logging timestamp { microseconds | milliseconds | seconds } |
Resets the logging time-stamp units to the default of seconds. |
|
(Optional) Displays the logging time-stamp units configured. |
||
(Optional) Copies the running configuration to the startup configuration. |
The following example shows how to configure the severity level and time-stamp units of messages:
switch(config)# logging module 3
switch(config)# show logging module
switch(config)# logging level aaa 2
switch(config)# logging timestamp milliseconds
Configuring syslog Servers
You can configure up to three syslog servers that reference remote systems where you want to log system messages.
For information about distributing the syslog configuration on the fabric, see the “Configuring syslog Server Configuration Distribution” section.
You can configure a syslog server on a UNIX or Linux system by adding the following line to the /etc/syslog.conf file:
Table 1-2 describes the syslog fields that you can configure.
To configure a syslog server on a UNIX or Linux system, follow these steps:
Step 1 Log debug messages with the local7 facility in the file /var/log/myfile.log by adding the following line to the /etc/syslog.conf file:
Step 2 Create the log file by entering these commands at the shell prompt:
Step 3 Make sure the system message logging daemon reads the new changes by checking myfile.log after entering this command:
To configure syslog servers, perform this task:
|
|
|
---|---|---|
switch(config)# logging server host [ severity-level [ facility ]] |
Configures a syslog server at the specified host name or IPv4 or IPv6 address. You can limit logging of messages with a minimum severity level and for a specific facility. Severity levels, which range from 0 to 7, are listed in Table 1-1 . The default outgoing facility is local7. |
|
(Optional) Copies the running configuration to the startup configuration. |
The following example shows how to configure a syslog server:
switch(config)# logging server 172.28.254.254 5 local3
Configuring syslog Server Configuration Distribution
You can distribute the syslog server configuration to other switches in the network by using the Cisco Fabric Services (CFS) infrastructure.
For more information about CFS, see the “Information About CFS” section.
After you enable syslog server configuration distribution, you can modify the syslog server configuration and view the pending changes before committing the configuration for distribution. As long as distribution is enabled, the switch maintains pending changes to the syslog server configuration.
Note If the switch is restarted, the syslog server configuration changes that are kept in volatile memory may be lost.
To configure syslog server configuration distribution, perform this task:
|
|
|
---|---|---|
Enables distribution of syslog server configuration to network switches using the CFS infrastructure. By default, distribution is disabled. |
||
Disables distribution of syslog server configuration to network switches using the CFS infrastructure. You cannot disable distribution when configuration changes are pending. See the logging commit and logging abort commands. By default, distribution is disabled. |
||
See the “Configuring syslog Servers” section. |
||
(Optional) Displays the pending changes to the syslog server configuration. |
||
(Optional) Displays the differences from the current syslog server configuration to the pending changes of the syslog server configuration. |
||
Commits the pending changes to the syslog server configuration for distribution to the switches in the fabric. |
||
Cancels the pending changes to the syslog server configuration. |
||
(Optional) Displays information about the current state of syslog server distribution and the last action taken. |
||
(Optional) Copies the running configuration to the startup configuration. |
Displaying and Clearing Log Files
To display or clear messages in the log file and the NVRAM, perform this task:
The following example shows how to display or clear messages in a log file:
switch# show logging logfile start-time 2007 nov 1 15:10:0
Verifying System Message Logging Configuration
To display system message logging configuration information, perform one of the following tasks:
System Message Logging Example Configuration
The following example shows how to configure system message logging:
Default Settings
Table 1-3 lists the default settings for system message logging parameters.
|
|
---|---|