5.6. Configuring Logging with CLI

This section provides information to configure logging using the command line interface.

5.6.1. Log Configuration Overview

Configure logging parameters to save information in a log file or direct the messages to other devices. Logging does the following:

  1. Provides you with logging information for monitoring and troubleshooting.
  2. Allows you to select the types of logging information to be recorded.
  3. Allows you to assign a severity to the log messages.
  4. Allows you to select the source and target of logging information.

5.6.1.1. Log Types

Logs can be configured in the following contexts:

  1. Log file — Log files can contain log event message streams or accounting/billing information. Log file IDs are used to direct events, alarms/traps and debug information to their respective targets.
  2. SNMP trap groups — SNMP trap groups contain an IP address and community names which identify targets to send traps following specified events.
  3. Syslog — Information can be sent to a syslog host that is capable of receiving selected syslog messages from a network element.
  4. Event control — Configures a particular event or all events associated with an application to be generated or suppressed.
  5. Event filters — An event filter defines whether to forward or drop an event or trap based on match criteria.
  6. Accounting policies — An accounting policy defines the accounting records that will be created. Accounting policies can be applied to one or more s access object or network objects.
  7. Event logs — An event log defines the types of events to be delivered to its associated destination.
  8. Event throttling rate — Defines the rate of throttling events.

5.6.2. Basic Event Log Configuration

The most basic log configuration must have the following:

  1. Log ID or accounting policy ID
  2. A log source
  3. A log destination

The following is a sample log configuration output.

A:ALA-12>config>log# info
#------------------------------------------
echo "Log Configuration "
#------------------------------------------
        event-control 2001 generate critical
        file-id 1
            description "This is a test file-id."
            location cf1:
        exit
        file-id 2
            description "This is a test log."
            location cf1:
        exit
        snmp-trap-group 7
            trap-target 11.22.33.44 "snmpv2c" notify-community "public"
        exit
        log-id 2
            from main
            to file 2
        exit
----------------------------------------------
A:ALA-12>config>log#
 

5.6.3. Common Configuration Tasks

The following sections are basic system tasks that must be performed.

5.6.3.1. Configuring an Event Log

A event log file contains information used to direct events, alarms, traps, and debug information to their respective destinations. One or more event sources can be specified. File IDs, SNMP trap groups, or syslog IDs must be configured before they can be applied to an event log ID.

Use the following syntax to configure a log file.

CLI Syntax:
config>log
log-id log-id
description description-string
filter filter-id
from {[main] [security] [change] [debug-trace]}
to console
to file file-id
to memory [size]
to session
to snmp [size]
to syslog syslog-id}
time-format {local|utc}
no shutdown

The following is a sample log file configuration output.

ALA-12>config>log>log-id# info
----------------------------------------------
...
log-id 2
            description "This is a test log file."
            filter 1
            from main security
            to file 1
exit
...
----------------------------------------------
ALA-12>config>log>log-id#

5.6.3.2. Configuring a File ID

To create a log file, a file ID is defined, the target CF or USB drive is specified, and the rollover retention interval period for the log file is defined. The rollover interval is defined in minutes and determines how long a file will be used before it is closed and a new log file is created. The retention interval determines how long the file will be stored on the storage device before it is deleted.

Use the following syntax to configure a log file.

CLI Syntax:
config>log
file-id log-file-id
description description-string
location cflash-id
rollover minutes [retention hours]

For the 7210 SAS-T:

CLI Syntax:
config>log
file-id log-file-id
description description-string
location cflash|usb-flash-id [backup-cflash-id]
rollover minutes [retention hours]

The following is a sample log file configuration output.

A:ALA-12>config>log# info
------------------------------------------
        file-id 1
            description "This is a log file."
            location cf1:
            rollover 600 retention 24
        exit
----------------------------------------------
A:ALA-12>config>log#
 

5.6.3.3. Configuring an Accounting Policy

Before an accounting policy can be created a target log file must be created to collect the accounting records. The files are stored in system memory of compact flash (cf1:) in a compressed (tar) XML format and can be retrieved using FTP or SCP. See Configuring an Event Log and Configuring a File ID.

Accounting policies must be configured in the config>log context before they can be applied to a service SAP or service interface, or applied to a network port.

The default accounting policy statement cannot be applied to LDP nor RSVP statistics collection records.

An accounting policy must define a record type and collection interval. Only one record type can be configured per accounting policy.

When creating accounting policies, one access, one access port, one network, one network interface and one SDP accounting policy can be defined as default. If statistics collection is enabled on an accounting object, and no accounting policy is applied, then the respective default accounting policy is used. If no default policy is defined, then no statistics are collected unless a specifically-defined accounting policy is applied.

Use the following syntax to configure an accounting policy.

CLI Syntax:
config>log>
accounting-policy acct-policy-id interval minutes
description description-string
default
record record-name
to file log-file-id
no shutdown

The following is a sample accounting policy configuration output.

A:ALA-12>config>log# info
----------------------------------------------
accounting-policy 5
description "This is a test accounting policy."
record service-ingress-packets
to file 3
exit
----------------------------------------------
A:ALA-12>config>log#

5.6.3.4. Configuring Event Control

Use the following CLI syntax to configure event control. Note that the throttle parameter used in the event-control command syntax enables throttling for a specific event type. The config>log>throttle-rate command configures the number of events and interval length to be applied to all event types that have throttling enabled by this event-control command.

CLI Syntax:
config>log
event-control application-id [event-name|event-number] generate [severity-level] [throttle]
event-control application-id [event-name|event-number] suppress
throttle-rate events [interval seconds]

The following is a sample event control configuration output.

A:ALA-12>config>log# info
#------------------------------------------
echo "Log Configuration"
#------------------------------------------
        throttle-rate 500 interval 10
        event-control "oam" 2001 generate throttle
        event-control "ospf" 2001 suppress
        event-control "ospf" 2003 generate cleared
        event-control "ospf" 2014 generate critical
..
----------------------------------------------
A:ALA-12>config>log>filter#

5.6.3.5. Configuring Throttle Rate

This command configures the number of events and interval length to be applied to all event types that have throttling enabled by the event-control command.

Use the following syntax to configure the throttle rate.

CLI Syntax:
config>log#
throttle-rate events [interval seconds]

The following is a sample throttle rate configuration output.

*A:gal171>config>log# info
---------------------------------------------
        throttle-rate 500 interval 10
        event-control "aps" 2001 generate throttle
----------------------------------------------

5.6.3.6. Configuring a Log Filter

Use the following syntax to configure a log filter.

CLI Syntax:
config>log
filter filter-id
default-action {drop|forward}
description description-string
entry entry-id
action {drop|forward}
description description-string
match
application {eq|neq} application-id
number {eq|neq|lt|lte|gt|gte} event-id
router {eq|neq} router-instance [regexp]
severity {eq|neq|lt|lte|gt|gte} severity-level
subject {eq|neq} subject [regexp]

The following is a sample log filter configuration output.

A:ALA-12>config>log# info
#------------------------------------------
echo "Log Configuration "
#------------------------------------------
        file-id 1
            description "This is our log file."
            location cf1:
            rollover 600 retention 24
        exit
        filter 1
            default-action drop
            description "This is a sample filter."
            entry 1
                action forward
                match
                    application eq "mirror"
                    severity eq critical
                exit
            exit
        exit
...
log-id 2
            shutdown
            description "This is a test log file."
            filter 1
            from main security
            to file 1
        exit
...
------------------------------------------
A:ALA-12>config>log#

5.6.3.7. Configuring an SNMP Trap Group

The associated log-id does not have to be configured before an snmp-trap-group can be created; however, the snmp-trap-group must exist before the log-id can be configured to use it.

Use the following syntax to configure an SNMP trap group.

CLI Syntax:
config>log
snmp-trap-group log-id
trap-target name [address ip-address] [port port] [snmpv1|snmpv2c| snmpv3] notify-community communityName |snmpv3SecurityName [security-level {no-auth-no-privacy|auth-no-privacy|privacy}]

The following is a sample basic SNMP trap group configuration output.

A:ALA-12>config>log# info
----------------------------------------------
...
snmp-trap-group 2
trap-target 10.10.10.104:5 "snmpv3" notify-community "coummunitystring" 
        exit
...
log-id 2
            description "This is a test log file."
            filter 1
            from main security
            to file 1
exit
...
----------------------------------------------
A:ALA-12>config>log#

5.6.3.8. Configuring SNMP Dying Gasp

Note:

  1. SNMP dying gasp for IPv4 is supported on all 7210 SAS platforms as described in this document, except the 7210 SAS-R6 and 7210 SAS-R12.
  2. SNMP dying gasp for IPv6 is not supported on any of the 7210 SAS platforms.

Use the following syntax to configure SNMP dying gasp.

CLI Syntax:
config>log
no snmp-dying-gasp primary trap-target-group-num trap-target-name [secondary {trap-target-group-num trap-target-name} [tertiary {trap-target-group-num trap-target-name}]]

Sample Configuration

*A:Dut-A>config>log# snmp-dying-gasp primary 7 server1 secondary 8 server2 
*A:Dut-A>config>log# info 
----------------------------------------------
        snmp-trap-group 7
            trap-target "server1" address 10.1.1.1 snmpv2c notify-community "public"
        exit 
        snmp-trap-group 8
            trap-target "server2" address 10.135.2.10 snmpv3 notify-
community "snmpv3user" security-level auth-no-privacy
        exit 
        snmp-trap-group 9
            trap-target "server3" address 10.2.2.2 snmpv3 notify-
community "snmpv3user" security-level auth-no-privacy
        exit 
        log-id 7 
            from main 
            to snmp
        exit 
        log-id 8 
            from main 
            to snmp
        exit 
        log-id 9 
            from main 
            to snmp
        exit 
        snmp-dying-gasp primary 7 "server1" secondary 8 "server2"
----------------------------------------------
*A:Dut-A>config>log#  

5.6.3.8.1. Configuration Guidelines for SNMP Dying Gasp Trap

The system does not try to resolve the ARP when it needs to send out the SNMP dying-gasp trap, since the amount of time available during power loss event is very less. Instead, the system assumes that ARP entry to the gateway used to reach the SNMP trap server is always available. Nokia recommends that users run a periodic ping query to the SNMP trap server in the background using the cron utility.

The following is a sample configuration output of a cron job which initiates a ping to the server mentioned in the pingscript file every one minute.

*7210-SAS># configure cron 
*7210-SAS >config>cron# info 
----------------------------------------------
        time-range "NO-TIME-RANGE" create
            description "NO-TIME-RANGE is the default always-on time-range"
        exit
----------------------------------------------
7210SAS>config>cron# 

5.6.3.9. Configuring a Syslog Target

Log events cannot be sent to a syslog target host until a valid syslog ID exists.

Use the following syntax to configure a syslog file.

CLI Syntax:
config>log
syslog syslog-id
description description-string
address ip-address
log-prefix log-prefix-string
port port
level {emergency|alert|critical|error|warning|notice|info|debug}
facility syslog-facility

The following is a sample syslog configuration output.

A:ALA-12>config>log# info
----------------------------------------------
...
        syslog 1
            description "This is a syslog file."
            address 10.10.10.104
            facility user
            level warning
        exit
...
----------------------------------------------
A:ALA-12>config>log#

5.6.4. Log Management Tasks

This section describes the logging tasks.

5.6.4.1. Modifying a Log File

Use the following syntax to modify a log file.

CLI Syntax:
config>log
log-id log-id
description description-string
filter filter-id
from {[main] [security] [change] [debug-trace]}
to console
to file file-id
to memory [size]
to session
to snmp [size]
to syslog syslog-id

The following is a sample current log configuration output.

ALA-12>config>log>log-id# info
----------------------------------------------
...
log-id 2
            description "This is a test log file."
            filter 1
            from main security
            to file 1
exit
...
----------------------------------------------
ALA-12>config>log>log-id#

The following shows the command usage to modify log file parameters.

Example:
 config# log config>log# log-id 2 config>log>log-id# description "Chassis log file." config>log>log-id# filter 2 config>log>log-id# from security config>log>log-id# exit

The following is a sample modified log file configuration output.

A:ALA-12>config>log# info
----------------------------------------------
...
log-id 2
            description "Chassis log file."
            filter 2
            from security
            to file 1
exit
...
----------------------------------------------
A:ALA-12>config>log#

5.6.4.2. Deleting a Log File

The log ID must be shut down first before it can be deleted. In a previous example, file 1 is associated with log-id 2.

A:ALA-12>config>log# info
----------------------------------------------
file-id 1
            description "LocationTest."
            location cf1:
            rollover 600 retention 24
        exit
...
log-id 2
            description "Chassis log file."
            filter 2
            from security
            to file 1
exit
...
----------------------------------------------
A:ALA-12>config>log#
 

Use the following syntax to delete a log file.

CLI Syntax:
config>log
no log-id log-id
shutdown

The following shows the command usage to delete a log file.

Example:
 config# log config>log# log-id 2 config>log>log-id# shutdown config>log>log-id# exit config>log# no log-id 2

5.6.4.3. Modifying a File ID

Note:

When the file-id location parameter is modified, log files are not written to the new location until a rollover occurs or the log is manually cleared. A rollover can be forced by using the clear>log command. Subsequent log entries are then written to the new location. If a rollover does not occur or the log not cleared, the old location remains in effect.

The location can be CF (cflash-id) or USB (usb-flash-id).

Use the following syntax to modify a log file.

CLI Syntax:
config>log
file-id log-file-id
description description-string
location [cflash-id]
rollover minutes [retention hours]

The following is a sample current log configuration output.

A:ALA-12>config>log# info
------------------------------------------
        file-id 1
            description "This is a log file."
            location cf1:
            rollover 600 retention 24
        exit
----------------------------------------------
A:ALA-12>config>log#

The following shows the command usage to modify log file parameters.

Example:
 config# log config>log# file-id 1 config>log>file-id# description "LocationTest." config>log>file-id# rollover 2880 retention 500 config>log>file-id# exit

The following is are sample file modifications.

A:ALA-12>config>log# info
----------------------------------------------
...
file-id 1
            description "LocationTest."
            location cf1:
            rollover 2880 retention 500
        exit
...
----------------------------------------------

5.6.4.4. Deleting a File ID

Note:

All references to the file ID must be deleted before the file ID can be removed.

Use the following syntax to delete a log ID.

CLI Syntax:
config>log
no file-id log-file-id

The following shows the command usage to delete a file ID.

Example:
 config>log# no file-id 1

5.6.4.5. Modifying a Syslog ID

Note:

All references to the syslog ID must be deleted before the syslog ID can be removed.

Use the following syntax to modify a syslog ID parameters.

CLI Syntax:
config>log
syslog syslog-id
description description-string
address ip-address
log-prefix log-prefix-string
port port
level {emergency|alert|critical|error|warning|notice|info|debug}
facility syslog-facility

The following shows the command usage to modify the syslog ID parameters.

Example:
 config# log config>log# syslog 1 config>log>syslog$description "Test syslog." config>log>syslog# address 10.10.0.91 config>log>syslog# facility mail config>log>syslog# level info

The following is a sample syslog configuration output.

A:ALA-12>config>log# info
----------------------------------------------
...
        syslog 1
            description "Test syslog."
            address 10.10.10.91
            facility mail
            level info
        exit
...
----------------------------------------------
A:ALA-12>config>log#

5.6.4.6. Deleting a Syslog

Use the following syntax to delete a syslog file.

CLI Syntax:
config>log
no syslog syslog-id

The following shows the command usage to delete a syslog ID.

Example:
 config# log config>log# no syslog 1

5.6.4.7. Modifying an SNMP Trap Group

Use the following syntax to modify an SNMP trap group.

CLI Syntax:
config>log
snmp-trap-group log-id
trap-target name [address ip-address] [port port] [snmpv1|snmpv2c| snmpv3] notify-community communityName |snmpv3SecurityName [security-level {no-auth-no-privacy|auth-no-privacy|privacy}]

The following is a sample current SNMP trap group configuration output.

A:ALA-12>config>log# info
----------------------------------------------
...
snmp-trap-group 10
trap-target 10.10.10.104:5 "snmpv3" notify-community "coummunitystring" 
        exit
...
----------------------------------------------
A:ALA-12>config>log#

The following shows the command usage to modify an SNMP trap group.

Example:
 config# log config>log# snmp-trap-group 10 config>log>snmp-trap-group# no trap-target 10.10.10.104:5 config>log>snmp-trap-group# snmp-trap-group# trap-target 10.10.0.91:1 snmpv2c notify-community "com1"

The following is a sample SNMP trap group configuration output.

A:ALA-12>config>log# info
----------------------------------------------
...
        snmp-trap-group 10
            trap-target 10.10.0.91:1 "snmpv2c" notify-community "com1”
        exit
...
----------------------------------------------
A:ALA-12>config>log#

5.6.4.8. Deleting an SNMP Trap Group

Use the following syntax to delete a trap target and SNMP trap group.

CLI Syntax:
config>log
no snmp-trap-group log-id
no trap-target name

The following is a sample SNMP trap group configuration output.

A:ALA-12>config>log# info
----------------------------------------------
...
       snmp-trap-group 10
           trap-target 10.10.0.91:1 "snmpv2c" notify-community "com1"
       exit
...
----------------------------------------------
A:ALA-12>config>log#

The following shows the command usage to delete a trap target and an SNMP trap group.

Example:
 config>log# snmp-trap-group 10 config>log>snmp-trap-group# no trap-target 10.10.0.91:1 config>log>snmp-trap-group# exit config>log# no snmp-trap-group 10

5.6.4.9. Modifying a Log Filter

Use the following syntax to modify a log filter.

CLI Syntax:
config>log
filter filter-id
default-action {drop|forward}
description description-string
entry entry-id
action {drop|forward}
description description-string
match
application {eq|neq} application-id
number {eq|neq|lt|lte|gt|gte} event-id
router {eq|neq} router-instance [regexp]
severity {eq|neq|lt|lte|gt|gte} severity-level
subject {eq|neq} subject [regexp]

The following is a sample current log filter configuration output.

ALA-12>config>log# info
#------------------------------------------
echo "Log Configuration "
#------------------------------------------
...
        filter 1
            default-action drop
            description "This is a sample filter."
            entry 1
                action forward
                match
                    application eq "mirror"
                    severity eq critical
                exit
            exit
        exit
...
------------------------------------------
ALA-12>config>log#

The following shows the command usage to modify the log filter.

Example:
 config# log config>log# filter 1 config>log>filter# description "This allows <n>." config>log>filter# default-action forward config>log>filter# entry 1 config>log>filter>entry$ action drop config>log>filter>entry# match config>log>filter>entry>match# application eq user config>log>filter>entry>match# number eq 2001 config>log>filter>entry>match# no severity config>log>filter>entry>match# exit

The following is a sample log filter configuration output.

A:ALA-12>config>log>filter# info
----------------------------------------
...
        filter 1
            description "This allows <n>."
            entry 1
                action drop
                match
                    application eq "user"
                    number eq 2001
                exit
            exit
        exit
...
----------------------------------------
A:ALA-12>config>log>filter#

5.6.4.10. Deleting a Log Filter

Use the following syntax to delete a log filter.

CLI Syntax:
config>log
no filter filter-id

The following is a sample current log filter configuration output.

A:ALA-12>config>log>filter# info
----------------------------------------
...
        filter 1
            description "This allows <n>."
            entry 1
                action drop
                match
                    application eq "user"
                    number eq 2001
                exit
            exit
        exit
...
----------------------------------------
A:ALA-12>config>log>filter#

The following shows the command usage to delete a log filter.

Example:
  config>log# no filter 1

5.6.4.11. Modifying Event Control Parameters

Use the following syntax to modify event control parameters.

CLI Syntax:
config>log
event-control application-id [event-name|event-number] generate [severity-level] [throttle]
event-control application-id [event-name|event-number] suppress

The following is a sample current event control configuration output.

A:ALA-12>config>log# info
----------------------------------------------
...
event-control 2014 generate critical
...
----------------------------------------------
A:ALA-12>config>log#

The following shows the command usage to modify event control.

Example:
 config# log config>log# event-control 2014 suppress

The following is a sample log filter configuration output.

A:ALA-12>config>log# info
----------------------------------------------
...
        event-control 2014 suppress
...
----------------------------------------------
A:ALA-12>config>log#

5.6.4.12. Returning to the Default Event Control Configuration

The no form of the event-control command returns modified values back to the default values.

Use the following syntax to modify event control parameters.

CLI Syntax:
config>log
no event-control application-id [event-name |event-nunmber]

The following shows the command usage to return to the default values.

Example:
 config# log config>log# no event-control 2001 config>log# no event-control 2002 config>log# no event-control 2014
A:ALA-12>config>log# info detail
----------------------------------------------
#------------------------------------------
echo "Log Configuration"
#------------------------------------------
        event-control 2001 generate minor
        event-control 2002 generate warning
        event-control 2003 generate warning
        event-control 2004 generate critical
        event-control 2005 generate warning
        event-control 2006 generate warning
        event-control 2007 generate warning
        event-control 2008 generate warning
        event-control 2009 generate warning
        event-control 2010 generate warning
        event-control 2011 generate warning
        event-control 2012 generate warning
        event-control 2013 generate warning
        event-control 2014 generate warning
        event-control 2015 generate critical
        event-control 2016 generate warning
...
----------------------------------------------
A:ALA-12>config>log#