Cisco MDS 9000 Family Configuration Guide, Release 1.2(2a)
Configuring System Message Logging

Table Of Contents

Configuring System Message Logging

About System Message Logging

System Log Message Format

Configuring System Message Logging

Enabling Message Logging

Configuring Console Severity Level

Configuring Module Logging

Configuring Facility Severity Level

Configuring Log Files

Configuring Syslog Servers

Outgoing Syslog Server Logging Facilities

Displaying System Message Logging Information

Default Settings


Configuring System Message Logging


This chapter describes how to configure system message logging on the Cisco MDS 9000 Family switches. It includes the following sections:

About System Message Logging

System Log Message Format

Configuring System Message Logging

Displaying System Message Logging Information

Default Settings

About System Message Logging

The system message logging software saves messages in a log file or directs the messages to other devices. This feature provides you with the following capabilities:

Provides logging information for monitoring and troubleshooting

Allows you to select the types of captured logging information.

Allows you to select the destination of the captured logging information.

By default, the switch logs normal but significant system messages to a log file and sends these messages to the system console. You can specify which system messages should be saved based on the type of facility (see Table 22-1) and the severity level (see Table 22-2). Messages are time-stamped to enhance real-time debugging and management.

You can access logged system messages using the CLI or by saving them to a properly configured syslog server. The switch software saves syslog messages in a file that can be configured to save up to 4 MB. You can monitor system messages remotely by accessing the switch through Telnet, SSH, or the console port, or by viewing the logs on a syslog server.


Note When the switch first initializes, the network is not connected until initialization completes. Therefore, messages are not redirected to a syslog server for a few seconds.


Log messages are not saved across system reboots. However, a maximum of 100 log messages with a severity level of critical and below (levels 0, 1, and 2) are saved in NVRAM. You can view this log at any time using the show logging nvram command.

Table 22-1 describes the facilities supported by the system message logs.

Table 22-1 Internal Logging Facilities 

Facility Keyword
Description
Standard or Cisco MDS Specific

acl

ACL manager

Cisco MDS 9000 Family specific

all

All facilities

Cisco MDS 9000 Family specific

auth

Authorization system

Standard

authpriv

Authorization (private) system

Standard

bootvar

Bootvar

Cisco MDS 9000 Family specific

callhome

Call Home

Cisco MDS 9000 Family specific

cron

Cron or at facility

Standard

daemon

System daemons

Standard

fcc

FCC

Cisco MDS 9000 Family specific

fcdomain

fcdomain

Cisco MDS 9000 Family specific

fcns

Name server

Cisco MDS 9000 Family specific

fcs

FCS

Cisco MDS 9000 Family specific

flogi

FLOGI

Cisco MDS 9000 Family specific

fspf

FSPF

Cisco MDS 9000 Family specific

ftp

File Transfer Protocol

Standard

ipconf

IP configuration

Cisco MDS 9000 Family specific

ipfc

IPFC

Cisco MDS 9000 Family specific

kernel

Kernel

Standard

local0 to local7

Locally defined messages

Standard

lpr

Line printer system

Standard

mail

Mail system

Standard

mcast

Multicast

Cisco MDS 9000 Family specific

module

Switching module

Cisco MDS 9000 Family specific

news

USENET news

Standard

ntp

NTP

Cisco MDS 9000 Family specific

platform

Platform manager

Cisco MDS 9000 Family specific

port

Port

Cisco MDS 9000 Family specific

port-channel

PortChannel

Cisco MDS 9000 Family specific

qos

QoS

Cisco MDS 9000 Family specific

rdl

RDL

Cisco MDS 9000 Family specific

rib

RIB

Cisco MDS 9000 Family specific

rscn

RSCN

Cisco MDS 9000 Family specific

securityd

Security

Cisco MDS 9000 Family specific

syslog

Internal syslog messages

Standard

sysmgr

System manager

Cisco MDS 9000 Family specific

tlport

TL port

Cisco MDS 9000 Family specific

user

User process

Standard

uucp

Unix-to-Unix copy system

Standard

vhbad

Virtual host base adapter daemon

Cisco MDS 9000 Family specific

vni

Virtual network interface

Cisco MDS 9000 Family specific

vrrp_cfg

VRRP configuration

Cisco MDS 9000 Family specific

vrrp_eng

VRRP engine

Cisco MDS 9000 Family specific

vsan

VSAN syslog

Cisco MDS 9000 Family specific

vshd

vshd

Cisco MDS 9000 Family specific

wwn

WWN manager

Cisco MDS 9000 Family specific

xbar

Xbar syslog

Cisco MDS 9000 Family specific

zone

Zone server

Cisco MDS 9000 Family specific


Table 22-2 describes the severity levels supported by the system message logs.

Table 22-2 Error Message Severity Levels 

Level Keyword
Level
Description
Syslog Definition

emergencies

0

System unusable

LOG_EMERG

alerts

1

Immediate action needed

LOG_ALERT

critical

2

Critical conditions

LOG_CRIT

errors

3

Error conditions

LOG_ERR

warnings

4

Warning conditions

LOG_WARNING

notifications

5

Normal but significant condition

LOG_NOTICE

informational

6

Informational messages only

LOG_INFO

debugging

7

Debugging messages

LOG_DEBUG


System Log Message Format

System log messages begin with a percent sign (%) and are displayed in the following format (see Table 22-3):

month dd hh:mm:ss switchname facility-severity-MNEMONIC description

For example:

Nov 8 14:07:58 excal-113 %LOG_MODULE-5-MOD_OK: Module 1 is online
Nov 8 14:07:58 excal-113 %LOG_PORT-3-IF_UNSUPPORTED_TRANSCEIVER: Transceiver for interface 
fc1/13 is not supported
Nov 8 14:07:59 excal-113 %LOG_PLATFORM-5-PS_OK: Power supply 1 ok
Nov 8 14:07:53 excal-113 %LOG_DAEMON-5-SYSTEM_MSG: readjusting service shell
Nov 8 15:59:38 excal-113 %LOG_KERN-6-SYSTEM_MSG: utaker: setting queue 1 control pid 1392 
(owner 1392) 
Nov 8 15:21:44 excal-113 %LOG_VSHD-5-VSHD_SYSLOG_CONFIG_I: Configuring console from pts/0 
(171.71.58.72)

Table 22-3 System Log Message Format Description 

Element
Description

month dd

The date and month of the error or event.

hh:mm:ss

The time of the error or event.

switchname

The name of the switch

facility

The facility of the error or event (daemon, kernel, VSHD, or other facility).

severity

Single-digit code from 0 to 7 that indicates the severity of the message.

MNEMONIC

Text string that uniquely describes the error message.

description

Text string containing detailed information about the event being reported


Configuring System Message Logging

System logging messages are sent to the console based on the default (or configured) logging facility and severity values.

Enabling Message Logging

You can disable logging to the console or enable logging to a given Telnet or SSH session.

When you disable or enable logging to a console session, that state is applied to all future console sessions. If you exit and log in again to a new session, the state is preserved.

When you enable or disable logging to a Telnet or SSH session. that state is applied only to that session. If you exit and log in again to a new session, the state is not preserved.

To enable or disable the logging state for a Telnet, or SSH session, follow these steps:

 
Command
Purpose

Step 1 

switch# terminal monitor

Enables logging for a Telnet, or SSH session.

Note A console session is enabled by default.

Step 2 

switch# terminal no monitor

Disables logging for a Telnet, or SSH session.

Note A Telnet or SSH session is disabled by default.

Configuring Console Severity Level

When logging is enabled for a console session (default), you can configure the severity levels of messages that appear on the console. The default severity for console logging is 2 (critical).

To configure the severity level for a logging facility, follow these steps:

 
Command
Purpose

Step 1 

switch# config t

switch(config)# 

Enters configuration mode.

Step 2 

switch(config)# logging console 3

Configures console logging at level 3 (error). Logging messages with a severity level of 3 or above will be displayed on the console.

switch(config)# logging console

Reverts console logging to the factory set default severity level of 2 (critical). Logging messages with a severity level of 2 or above will be displayed on the console.


Tip The current critical (default) logging level is maintained, if the console baud speed is 9600 baud (default). All attempts to change the console logging level generates an error message. T o increase the logging level (above critical), you must change the console baud speed to 38400 baud (see the "Configuring Console Settings" section).


Configuring Module Logging

By default, logging is enabled at Level 7 for all modules. You can enable or disable logging for each module at a specified level.

To configure the severity level for a logging facility, follow these steps:

 
Command
Purpose

Step 1 

switch# config t

switch(config)# 

Enters configuration mode.

Step 2 

switch(config)# logging module 1

Configures module logging at Level 1 (alerts).

switch(config)# logging module 

Configures module logging for all modules in the switch.

switch(config)# no logging console

Reverts console logging to the factory set default severity level of 5 (notification). Logging messages with a severity level of 5 or above will be displayed on the console.

Configuring Facility Severity Level

To configure the severity level for a logging facility, follow these steps:

 
Command
Purpose

Step 1 

switch# config t

switch(config)# 

Enters configuration mode.

Step 2 

switch(config)# logging level kernel 4 

Configures Telnet or SSH logging for the kernel facility at level 4 (warning). As a result, logging messages with a severity level of 4 or above will be displayed.

Configuring Log Files

Logging messages may be saved to a log file. You can configure the name of this file and restrict its size as required. The default log file name is messages. You can rename this file using the logging logfile command. The file name can have up to 200 characters and the file size ranges from 4096 bytes to 4194304 bytes.

To send log messages to file, follow these steps:

 
Command
Purpose

Step 1 

switch# config t

switch(config)# 

Enters configuration mode.

Step 2 

switch(config)# logging logfile 
ManagerLog 3 size 3000000 

Configures logging information for errors or events above severity level 3 to be logged in a file named ManagerLog. By configuring a size, you are restricting the file size to 3000000 bytes. The maximum upper limit is 4194304 (default).

The configured log file is saved in the /var/log/external directory. The location of the log file cannot be changed. You can use the show logging and clear debug-logfile commands to view and clear this file. It is not accessible using the dir command.

You can display the log file using the show logging logfile command and copy the logfile to a different location using the copy log:messages command using additional copy syntax (see the "Copying Files" section).

Configuring Syslog Servers

To send log messages to a UNIX syslog server, you must configure the syslog daemon on a UNIX server. Log in as root, and perform these steps:


Step 1 Add the following line to the file /etc/syslog.conf

local7.debug								/var/log/myfile.log


Note Be sure to add five tab characters between local7.debug and /var/log/myfile.log. Refer to entries in the /etc/syslog.conf file for further examples.


The switch sends messages according to the specified facility types and severity levels. The local7 keyword specifies the UNIX logging facility used. The messages from the switch are generated by user processes. The debug keyword specifies the severity level of the condition being logged. You can set UNIX systems to receive all messages from the switch.

Step 2 Create the log file by entering these commands at the UNIX shell prompt:

$ touch /var/log/myfile.log
$ chmod 666 /var/log/myfile.log

Step 3 Make sure the syslog daemon reads the new changes by entering this command:

$ kill -HUP ~cat /etc/syslog.pid~


To configure syslog servers, follow these steps:

 
Command
Purpose

Step 1 

switch# config t

switch# 

Enters configuration mode.

Step 2 

switch(config)# logging server 
172.22.00.00
switch(config)# 

Configures the switch to forward log messages according to the specified facility types and severity levels to remote multiple servers specified by its hostname or IP address (172.22.00.00).

Note You can configure a maximum of three syslog servers.

switch(config)# logging server 
172.22.00.00 facility local1
switch(config)# 

Configures the switch to forward log messages according to the specified facility (local1) for the server IP address (172.22.00.00). The default outgoing facility is local7.

switch(config)# no logging server 
172.11.00.00 
switch(config)# 

Removes the specified server (172.11.00.00) and reverts to factory default.

Note You can configure a maximum of three syslog servers.

Outgoing Syslog Server Logging Facilities

All syslog messages have a logging facility and a level. The logging facility can be thought of as where and the level can be thought of as what.

The single syslog daemon (syslogd) sends the information based on the configured facility option. If no facility is specified, local7 is the default outgoing facility.

The internal facilities are listed in Table 22-1 and the outgoing logging facilities are listed in Table 22-4.

Table 22-4 Outgoing Logging Facilities

Facility Keyword
Description
Standard or Cisco MDS Specific

auth

Authorization system

Standard

authpriv

Authorization (private) system

Standard

cron

Cron or at facility

Standard

daemon

System daemons

Standard

ftp

File Transfer Protocol

Standard

kernel

Kernel

Standard

local0 to local7

Locally defined messages

Standard (local7 is the default)

lpr

Line printer system

Standard

mail

Mail system

Standard

news

USENET news

Standard

syslog

Internal syslog messages

Standard

user

User process

Standard

uucp

Unix-to-Unix copy system

Standard


Displaying System Message Logging Information

Use the show logging command to display the current system message logging configuration. See Examples 22-1 to 22-10.

Example 22-1 Displays Current System Message Logging

switch# show logging 
Logging console:                enabled (Severity: critical)
Logging monitor:                enabled (Severity: debugging)
Logging linecard:               enabled (Severity: debugging)
Logging server:                 enabled
{172.20.102.34}
        server severity:        debugging
        server facility:        local7
{10.77.202.88}
        server severity:        debugging
        server facility:        local7
{10.77.202.149}
        server severity:        debugging
        server facility:        local7
Logging logfile:                enabled
        Name - messages: Severity - debugging Size - 4194304

Facility        Default Severity        Current Session Severity
--------        ----------------        ------------------------
kern                    6                       6
user                    3                       3
mail                    3                       3
daemon                  7                       7
auth                    0                       7
syslog                  3                       3
lpr                     3                       3
news                    3                       3
uucp                    3                       3
cron                    3                       3
authpriv                3                       7
ftp                     3                       3
local0                  3                       3
local1                  3                       3
local2                  3                       3
local3                  3                       3
local4                  3                       3
local5                  3                       3
local6                  3                       3
local7                  3                       3
vsan                    2                       2
fspf                    3                       3
fcdomain                2                       2
module                  5                       5
sysmgr                  3                       3
zone                    2                       2
vni                     2                       2
ipconf                  2                       2
ipfc                    2                       2
xbar                    3                       3
fcns                    2                       2
fcs                     2                       2
acl                     2                       2
tlport                  2                       2
port                    5                       5
flogi                   2                       2
port_channel            5                       5
wwn                     3                       3
fcc                     2                       2
qos                     3                       3
vrrp_cfg                2                       2
ntp                     2                       2
platform                5                       5
vrrp_eng                2                       2
callhome                2                       2
mcast                   2                       2
rdl                     2                       2
rscn                    2                       2
bootvar                 5                       2
securityd               2                       2
vhbad                   2                       2
rib                     2                       2
vshd                    5                       5

0(emergencies)          1(alerts)       2(critical)
3(errors)               4(warnings)     5(notifications)
6(information)          7(debugging)

Feb 14 09:50:57 excal-113 %TTYD-6-TTYD_MISC: TTYD TTYD started 
Feb 14 09:50:58 excal-113 %DAEMON-6-SYSTEM_MSG: precision = 8 usec
...

Use the show logging nvram command to view the log messages saved in NVRAM. Only log messages with a severity level of critical and below (levels 0, 1, and 2) are saved in NVRAM.

Example 22-2 Displays NVRM Log Contents

switch# show logging nvram
Jul 16 20:36:46 172.22.91.204 %KERN-2-SYSTEM_MSG: unable to alloc and fill in a
new mtsbuf (pid=2209, ret_val = -105)
Jul 16 20:36:46 172.22.91.204 %KERN-2-SYSTEM_MSG: unable to alloc and fill in a
new mtsbuf (pid=2199, ret_val = -105)
Jul 16 20:36:46 172.22.91.204 %KERN-2-SYSTEM_MSG: unable to alloc and fill in a
new mtsbuf (pid=2213, ret_val = -105)
Jul 16 20:36:46 172.22.91.204 %KERN-2-SYSTEM_MSG: unable to alloc and fill in a
new mtsbuf (pid=2213, ret_val = -105)
...

Example 22-3 Displays the Log File

switch# show logging logfile
Jul 16 21:06:50 %DAEMON-3-SYSTEM_MSG: Un-parsable frequency in /mnt/pss/ntp.drift
Jul 16 21:06:56 %DAEMON-3-SYSTEM_MSG: snmpd:snmp_open_debug_cfg: no snmp_saved_dbg_uri ;
Jul 16 21:06:58 172.22.91.204 %PORT-5-IF_UP: Interface mgmt0 is up
Jul 16 21:06:58 172.22.91.204 %MODULE-5-ACTIVE_SUP_OK: Supervisor 5 is active
...

Example 22-4 Displays Console Logging Status

switch# show logging console 
Logging console:                enabled (Severity: notifications)

Example 22-5 Displays Logging Facility

switch# show logging level
Facility        Default Severity        Current Session Severity
--------        ----------------        ------------------------
kern                    6                       6
user                    3                       3
mail                    3                       3
daemon                  7                       7
auth                    0                       7
syslog                  3                       3
lpr                     3                       3
news                    3                       3
uucp                    3                       3
cron                    3                       3
authpriv                3                       7
ftp                     3                       3
local0                  3                       3
local1                  3                       3
local2                  3                       3
local3                  3                       3
local4                  3                       3
local5                  3                       3
local6                  3                       3
local7                  3                       3
vsan                    2                       2
fspf                    3                       3
fcdomain                2                       2
module                  5                       5
sysmgr                  3                       3
zone                    2                       2
vni                     2                       2
ipconf                  2                       2
ipfc                    2                       2
xbar                    3                       3
fcns                    2                       2
fcs                     2                       2
acl                     2                       2
tlport                  2                       2
port                    5                       5
flogi                   2                       2
port_channel            5                       5
wwn                     3                       3
fcc                     2                       2
qos                     3                       3
vrrp_cfg                2                       2
ntp                     2                       2
platform                5                       5
vrrp_eng                2                       2
callhome                2                       2
mcast                   2                       2
rdl                     2                       2
rscn                    2                       2
bootvar                 5                       2
securityd               2                       2
vhbad                   2                       2
rib                     2                       2
vshd                    5                       5

0(emergencies)          1(alerts)       2(critical)
3(errors)               4(warnings)     5(notifications)
6(information)          7(debugging)

Example 22-6 Displays Logging Information

switch# show logging info 
Logging console:                enabled (Severity: critical)
Logging monitor:                enabled (Severity: debugging)
Logging linecard:               enabled (Severity: debugging)
Logging server:                 enabled
{172.20.102.34}
        server severity:        debugging
        server facility:        local7
{10.77.202.88}
        server severity:        debugging
        server facility:        local7
{10.77.202.149}
        server severity:        debugging
        server facility:        local7
Logging logfile:                enabled
        Name - messages: Severity - debugging Size - 4194304

Facility        Default Severity        Current Session Severity
--------        ----------------        ------------------------
kern                    6                       6
user                    3                       3
mail                    3                       3
daemon                  7                       7
auth                    0                       7
syslog                  3                       3
lpr                     3                       3
news                    3                       3
uucp                    3                       3
cron                    3                       3
authpriv                3                       7
ftp                     3                       3
local0                  3                       3
local1                  3                       3
local2                  3                       3
local3                  3                       3
local4                  3                       3
local5                  3                       3
local6                  3                       3
local7                  3                       3
vsan                    2                       2
fspf                    3                       3
fcdomain                2                       2
module                  5                       5
sysmgr                  3                       3
zone                    2                       2
vni                     2                       2
ipconf                  2                       2
ipfc                    2                       2
xbar                    3                       3
fcns                    2                       2
fcs                     2                       2
acl                     2                       2
tlport                  2                       2
port                    5                       5
flogi                   2                       2
port_channel            5                       5
wwn                     3                       3
fcc                     2                       2
qos                     3                       3
vrrp_cfg                2                       2
ntp                     2                       2
platform                5                       5
vrrp_eng                2                       2
callhome                2                       2
mcast                   2                       2
rdl                     2                       2
rscn                    2                       2
bootvar                 5                       2
securityd               2                       2
vhbad                   2                       2
rib                     2                       2
vshd                    5                       5

0(emergencies)          1(alerts)       2(critical)
3(errors)               4(warnings)     5(notifications)
6(information)          7(debugging)

Example 22-7 Displays Last Few Lines of a Log File

switch# show logging last 2
Nov 8 16:48:04 excal-113 %LOG_VSHD-5-VSHD_SYSLOG_CONFIG_I: Configuring console from pts/1 
(171.71.58.56)
Nov 8 17:44:09 excal-113 %LOG_VSHD-5-VSHD_SYSLOG_CONFIG_I: Configuring console from pts/0 
(171.71.58.72)

Note Use the show logging filename command to display the entire log file.


Example 22-8 Displays Switching Module Logging Status

switch# show logging module 
Logging linecard:               enabled (Severity: debugging) 

Example 22-9 Displays Monitor Logging Status

switch# show logging monitor 
Logging monitor:                enabled (Severity: information) 

Note Use the show logging nvram command to view the log messages in NVRAM.


Example 22-10 Displays Server Information

switch# show logging server 
Logging server:                 enabled
{172.22.95.167}
        server severity:        debugging
        server facility:        local7
{172.22.92.58}
        server severity:        debugging
        server facility:        local7

Default Settings

Table 22-5 lists the default settings for system message logging.

Table 22-5 Default System Message Log Setting 

Parameters
Default

System message logging to the console

Enabled for messages at the critical severity level.

System message logging to Telnet sessions

Disabled.

Logging file size

4194304.

Log file name

message (can be changed to any name with up to 200 characters).

Logging server

Disabled.

Syslog server IP address

Non configured.

No. of servers

3 servers.

Server facility

Local 7.