Email Alerting and Mail Server Commands
Use these commands to configure email alerting and the mail server.
logging email
M4250
M4350
This command enables email alerting and sets the lowest severity level for which log messages are emailed. If you specify a severity level, log messages at or above this severity level, but below the urgent severity level, are emailed in a non-urgent manner by collecting them together until the log time expires. You can 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 | disabled; when enabled, log messages at or above severity Warning (4) are emailed |
| Format | logging email [severitylevel] |
| Mode | Global Config |
no logging email
This command disables email alerting.
| Format | no logging email |
| Mode | Global Config |
logging email urgent
M4250
M4350
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. |
| Format | logging email urgent {severitylevel | none} |
| Mode | Global Config |
no logging email urgent
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
M4250
M4350
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.
| Format | logging email message-type {urgent | non-urgent | both} to-addr to-email-addr |
| Mode | Global Config |
no logging email message-type to-addr
This command removes the configured to-addr field of email.
| Format | no logging email message-type {urgent | non-urgent | both} to-addr to-email-addr |
| Mode | Global Config |
logging email from-addr
M4250
M4350
This command configures the email address of the sender (the switch).
| Default | switch@netgear.com |
| Format | logging email from-addr from-email-addr |
| Mode | Global Config |
no logging email from-addr
This command removes the configured email source address.
| Format | no logging email from-addr from-email-addr |
| Mode | Global Config |
logging email message-type subject
M4250
M4350
This command configures the subject line of the email for the specified type.
| Default |
For urgent messages: Urgent Log Messages For non-urgent messages: Non Urgent Log Messages |
| Format | logging email message-type {urgent | non-urgent | both} subject subject |
| Mode | Global Config |
no logging email message-type subject
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
M4250
M4350
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 minutes argument is a number in the range 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
M4250
M4350
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
M4250
M4350
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
M4250
M4350
This command displays information about the email alert configuration.
| Format | show logging email config |
| Mode | Privileged EXEC |
| Term | Definition |
|---|---|
| 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
M4250
M4350
This command displays email alerting statistics.
| Format | show logging email statistics |
| Mode | Privileged EXEC |
| Term | Definition |
|---|---|
| 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
M4250
M4350
This command resets the email alerting statistics.
| Format | clear logging email statistics |
| Mode | Privileged EXEC |
mail-server
M4250
M4350
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.
| Format | mail-server {ip-address | ipv6-address | hostname} |
| Mode | Global Config |
no mail-server
This command removes the specified SMTP server from the configuration.
| Format | no mail-server {ip-address | ipv6-address | hostname} |
| Mode | Global Config |
security (Mail Server Config)
M4250
M4350
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 server does not support TLS mode, no email is sent to the SMTP server.
| Default | none |
| Format | security {tlsv1 | none} |
| Mode | Mail Server Config |
port (Mail Server Config)
M4250
M4350
This command configures the TCP port to use for communication with the SMTP server. The recommended port number for TLSv1 is 465, and for no security (that is, none) it is port number 25. However, any nonstandard port number in the range 1 to 65535 is also allowed.
| Default | 25 |
| Format | port number |
| Mode | Mail Server Config |
username (Mail Server Config)
M4250
M4350
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 (Mail Server Config)
M4250
M4350
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
M4250
M4350
This command displays information about the email alert configuration.
| Format | show mail-server [ip-address | hostname | all] config |
| Mode | Privileged EXEC |
| Term | Definition |
|---|---|
| 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. |