This section describes the commands you use for configure email alerting and settings.
logging email urgent
This command sets the lowest severity level at which log messages are emailed immediately in a single email message. Specify the <severitylevel> value as either an integer from 0 to 7 or symbolically through one of the following keywords: emergency(0), alert (1), critical(2), error(3), warning (4), notice (5), info (6), or debug (7). Specify none to indicate that log messages are collected and sent in a batch email at a specified interval.
Default: Alert (1) and emergency (0) messages are sent immediately.
This command resets the urgent severity level to the default value.
Format: no logging email urgent
Mode: Global Config
logging email message-type to-addr
This command configures the email address to which messages are sent. The message types supported are urgent, non-urgent, and both. For each supported severity level, multiple email addresses can be configured. The <to-email-addr> variable is a standard email address, for example admin@yourcompany.com.
This command removes the configured email subject for the specified message type and restores it to the default email subject.
Format: no logging email message-type {urgent |non-urgent |both} subject
Mode: Global Config
logging email logtime
This command configures how frequently non-urgent email messages are sent. Non-urgent messages are collected and sent in a batch email at the specified interval. The valid range is every 30 - 1440 minutes.
Default: 30 minutes
Format: logging email logtime <minutes>
Mode: Global Config
no logging email logtime
This command resets the non-urgent log time to the default value.
Format: no logging email logtime
Mode: Global Config
logging traps
This command sets the severity at which SNMP traps are logged and sent in an email. Specify the <severitylevel> value as either an integer from 0 to 7 or symbolically through one of the following keywords: emergency(0), alert (1), critical(2), error(3), warning (4), notice (5), info (6), or debug (7).
Default: Info (6) messages and higher are logged.
Format: logging traps <severitylevel>
Mode: Global Config
no logging traps
This command resets the SNMP trap logging severity level to the default value.
Format: no logging traps
Mode: Global Config
logging email test message-type
This command sends an email to the SMTP server to test the email alerting function.
Format: logging email test message-type {urgent |non-urgent |both} message-body <message-body>
Mode: Global Config
show logging email config
This command displays information about the email alert configuration.
Format: show logging email config
Mode: Privileged EXEC
The display parameters for above command are:
Email Alert Logging: The administrative status of the feature: enabled or disabled
Email Alert From Address: The email address of the sender (the switch).
Email Alert Urgent Severity Level: The lowest severity level that is considered urgent. Messages of this type are sent immediately.
Email Alert Non Urgent Severity Level: The lowest severity level that is considered non-urgent. Messages of this type, up to the urgent level, are collected and sent in a batch email. Log messages that are less severe are not sent in an email message at all.
Email Alert Trap Severity Level: The lowest severity level at which traps are logged.
Email Alert Notification Period: The amount of time to wait between non-urgent messages.
Email Alert To Address Table: The configured email recipients.
Email Alert Subject Table: The subject lines included in urgent (Type 1) and non-urgent (Type 2) messages.
For Msg Type urgent, subject is: The configured email subject for sending urgent messages. For
Msg Type non-urgent, subject is: The configured email subject for sending non-urgent messages.
show logging email statistics
This command displays email alerting statistics.
Format: show logging email statistics
Mode: Privileged EXEC
The display parameters for above command are:
Email Alert Operation Status: The operational status of the email alerting feature.
No of Email Failures: The number of email messages that have attempted to be sent but were unsuccessful.
No of Email Sent: The number of email messages that were sent from the switch since the counter was cleared.
Time Since Last Email Sent: The amount of time that has passed since the last email was sent from the switch.
clear logging email statistics
This command resets the email alerting statistics.
Format: clear logging email statistics
Mode: Privileged EXEC
mail-server
This command configures the SMTP server to which the switch sends email alert messages and changes the mode to Mail Server Configuration mode. The server address can be in the IPv4, IPv6, or DNS name format.
This command removes the specified SMTP server from the configuration.
Format: no mail-server {<ip-address> | <ipv6-address> |<hostname>}
Mode: Global Config
security
This command sets the email alerting security protocol by enabling the switch to use TLS authentication with the SMTP Server. If the TLS mode is enabled on the switch but the SMTP sever does not support TLS mode, no email is sent to the SMTP server.
Default: none
Format: security {tlsv1 | none}
Mode: Mail Server Config
port
This command configures the TCP port to use for communication with the SMTP server. The recommended port for TLSv1 is 465, and for no security (i.e. none) it is 25. However, any nonstandard port in the range 1 to 65535 is also allowed.
Default: 25
Format: port {465 | 25 | 1–65535}
Mode: Mail Server Config
username (Mail Server Config)
This command configures the login ID the switch uses to authenticate with the SMTP server.
Default: admin
Format: username <name>
Mode: Mail Server Config
password
This command configures the password the switch uses to authenticate with the SMTP server.
Default: admin
Format: password <password>
Mode: Mail Server Config
show mail-server config
This command displays information about the email alert configuration.
Format: show mail-server {<ip-address> | <hostname> | all} config
Mode: Privileged EXEC
The display parameters for above command are:
No of mail servers configured: The number of SMTP servers configured on the switch.
Email Alert Mail Server Address: The IPv4/IPv6 address or DNS hostname of the configured SMTP server.
Email Alert Mail Server Port: The TCP port the switch uses to send email to the SMTP server
Email Alert Security Protocol: The security protocol (TLS or none) the switch uses to authenticate with the SMTP server.
Email Alert Username: The username the switch uses to authenticate with the SMTP server.
Email Alert Password: The password the switch uses to authenticate with the SMTP server.