B ncs5000 System Monitoring Configuration Guide 60x - Chapter - 010
B ncs5000 System Monitoring Configuration Guide 60x - Chapter - 010
This module describes the tasks you need to implement logging services on the router.
The Cisco IOS XR Software provides basic logging services. Logging services provide a means to gather
logging information for monitoring and troubleshooting, to select the type of logging information captured,
and to specify the destinations of captured system logging (syslog) messages.
• Implementing System Logging , on page 1
The following table describes the general format of syslog messages on Cisco IOS XR software.
Field Description
Field Description
Configuration Example
This example shows the configuration for sending syslog messages to the logging buffer. The size of the
logging buffer is configured as 3000000 bytes. The default value for the size of the logging buffer is 2097152
bytes.
RP/0/RP0/CPU0:Router# configure
RP/0/RP0/CPU0:Router(config)# logging buffered 3000000
RP/0/RP0/CPU0:Router(config)# commit
Features Description
UNIX system log facility Facility is the identifier used by UNIX to describe the
application or process that submitted the log message.
You can configure the syslog facility in which syslog
messages are sent by using the logging facility
command.
Features Description
Syslog source address logging By default, a syslog message sent to a syslog server
contains the IP address of the interface it uses to leave
the router. Use the logging source-interface
command to set all syslog messages to contain the
same IP address, regardless of which interface the
syslog message uses to exit the router.
Configuration Example
This example shows the configuration for sending syslog messages to an external syslog server. The ip address
10.3.32.154 is configured as the syslog server and the logging trap command is used to limit the syslog
messages sent to syslog servers based on severity.
RP/0/RP0/CPU0:Router# configure
RP/0/RP0/CPU0:Router(config)# logging 10.3.32.154
RP/0/RP0/CPU0:Router(config)# logging trap warnings
RP/0/RP0/CPU0:Router(config)# logging facility kern (optional)
RP/0/RP0/CPU0:Router(config)# logging hostnameprefix 123.12.35.7 (optional)
RP/0/RP0/CPU0:Router(config)# logging source-interface TenGigE 0/0/0/10(optional)
RP/0/RP0/CPU0:Router(config)# commit
Configuration Example
This example shows the configuration for sending syslog messages to terminal lines other than console. In
this example, severity level is configured as critical. The terminal monitor command is configured to display
syslog messages during a terminal session. The default severity level is debugging.
RP/0/RP0/CPU0:Router# configure
RP/0/RP0/CPU0:Router(config)# logging monitor critical
RP/0/RP0/CPU0:Router(config)# commit
RP/0/RP0/CPU0:Router# terminal monitor
Configuration Example
This example shows how to modify the logging of syslog messages to the console terminal.
RP/0/RP0/CPU0:Router# configure
RP/0/RP0/CPU0:Router(config)# logging console alerts
RP/0/RP0/CPU0:Router(config)# commit
Configuration Example
This example shows how to modify the time-stamp for syslog and debugging messages.
RP/0/RP0/CPU0:Router# configure
RP/0/RP0/CPU0:Router(config)# service timestamps log datetime localtime msec or service
timestamps log uptime
RP/0/RP0/CPU0:Router(config)# service timestamps debug datetime msec show-timezone or service
timestamps debug uptime
RP/0/RP0/CPU0:Router(config)# commit
Configuration Example
This example shows how to suppress the consecutive logging of duplicate syslog messages.
RP/0/RP0/CPU0:Router# configure
RP/0/RP0/CPU0:Router(config)# logging suppress duplicates
RP/0/RP0/CPU0:Router(config)# commit
Features Description
Features Description
device {disk0 | disk1 | harddisk} Specifies the local storage device where syslogs are
archived. By default, the logs are created under the
directory device/var/log. If the device is not
configured, then all other logging archive
configurations are rejected. We recommend that
syslogs be archived to the harddisk because it has
more capacity than flash disks.
file-size size Specifies the maximum file size (in megabytes) that
a single log file in the archive can grow to. Once this
limit is reached, a new file is automatically created
with an increasing serial number.
Configuration Example
This example shows how to save syslog messages to an archive on a local storage device.
RP/0/RP0/CPU0:Router# configure
RP/0/RP0/CPU0:Router(config)# logging archive
RP/0/RP0/CPU0:Router(config-logging-arch)# device disk1
RP/0/RP0/CPU0:Router(config-logging-arch)# frequency weekly
RP/0/RP0/CPU0:Router(config-logging-arch)# severity warnings
RP/0/RP0/CPU0:Router(config-logging-arch)# archive-length 6
RP/0/RP0/CPU0:Router(config-logging-arch)# archive-size 50
RP/0/RP0/CPU0:Router(config-logging-arch)# file-size 10
RP/0/RP0/CPU0:Router(config)# commit