- Table of Contents
-
- 13-Network Management and Monitoring Command Reference
- 00-Preface
- 01-System maintenance and debugging commands
- 02-NQA commands
- 03-NTP commands
- 04-SNMP commands
- 05-RMON commands
- 06-Event MIB commands
- 07-NETCONF commands
- 08-EAA commands
- 09-Process monitoring and maintenance commands
- 10-BFD commands
- 11-Track commands
- 12-Process placement commands
- 13-Fast log output commands
- 14-Flow log commands
- 15-Information center commands
- 16-Packet capture commands
- 17-Email alerting commands
- Related Documents
-
Title | Size | Download |
---|---|---|
17-Email alerting commands | 80.36 KB |
Email alerting commands
The following compatibility matrix shows the support of hardware platforms for email alerting:
Series |
Models |
Email alerting compatibility |
L5000 series |
L5000-C, L5000-S, L5000-E, L5030, L5060, L5080, L5000-AK535 |
Yes |
L1000 series |
L1000-C, L1000-S, L1000-M, L1000-E, L1000-AK310, L1000-AK315, L1000-AK320, L1000-AK325, L1000-AK330, L1000-AK390, L1030, L1050, L1070, L1090 |
Yes |
L100 series |
L100-C |
Yes |
Modules |
LSU1ADECEA0 |
Yes |
LSWM1ADED0, LSQM1ADEDSC0 |
No |
display email-server
Use display email-server to display email server configuration.
Syntax
display email-server [ name server-name ]
Views
Any view
Predefined user roles
network-admin
network-operator
context-admin
context-operator
Parameters
name server-name: Specifies an email server by its name, a case-sensitive string of 1 to 63 characters. If you do not specify an email server, this command displays the configuration of all email servers.
Examples
# Display the configuration of all email servers.
<Sysname> display email-server
Server name: mail_server
Domain name: www.server.com
IPv4 address:
IPv6 address:
Port number: 7025
Email server client-authentication: Enabled
Email server username: admin
Server name: smtp-server1
Domain name:
IPv4 address: 192.168.1.121
IPv6 address:
Port number: 25
Email server client-authentication: Enabled
Email server username: admin
# Display the configuration of email server smtp-server1.
<Sysname> display email-server name smtp-server1
Server name: smtp-server1
Domain name:
IPv4 address: 192.168.1.121
IPv6 address:
Port number: 3000
Email server client-authentication: Enabled
Email server username: admin
display send-email
Use display send-email to display email sending settings.
Syntax
display send-email [ type warning ]
Views
Any view
Predefined user roles
network-admin
network-operator
context-admin
context-operator
Parameters
type warning: Specifies the warning type. If you do not specify this keyword, the command displays email sending settings of all types.
Examples
# Display the email sending settings of the warning type.
<Sysname> display send-email type warning
Email type: Warning
Event: link-failure, node-failure
Email server: smtp-server1
Email subject: test
Email recipients: [email protected]
Email sender: [email protected]
Email sending frequency: 60 sec
Email sending function state: Enabled
email-frequency
Use email-frequency to set the frequency at which alert emails are sent.
Use undo email-frequency to restore the default.
Syntax
email-frequency interval
undo email-frequency
Default
Alert emails are sent at 60-second intervals.
Views
Warning type email view
Predefined user roles
network-admin
context-admin
Parameters
interval: Specifies the email sending interval in the range of 60 to 3600 seconds.
Usage guidelines
This command allows you to set the interval at which alert emails are sent to the recipients' email addresses.
Examples
# Set the email sending interval to 90 seconds.
<Sysname> system-view
[Sysname] send-email type warning
[Sysname-email-warning] email-frequency 90
email-recipients
Use email-recipients to configure the email addresses to receive alert emails.
Use undo email-recipients to restore the default.
Syntax
email-recipients mail-address
undo email-recipients
Default
No recipients' email addresses are configured.
Views
Email view
Predefined user roles
network-admin
context-admin
Parameters
mail-address: Specifies an email address, a case-insensitive string of 1 to 255 characters, or specify multiple email addresses separated by semicolons.
Examples
# Configure the recipients' email addresses as [email protected] and [email protected].
<Sysname> system-view
[Sysname] send-email type warning
[Sysname-email-warning] email-recipients [email protected];[email protected]
email-sender
Use email-sender to configure the email address to send alert emails.
Use undo email-sender to restore the default.
Syntax
email-sender mail-address
undo email-sender
Default
No sender's email address is configured.
Views
Email view
Predefined user roles
network-admin
context-admin
Parameters
mail-address: Specifies an email address, a case-insensitive string of 1 to 255 characters. The email address cannot end with a semicolon.
Usage guidelines
Only one sender's email address is allowed. If you execute this command multiple times, the most recent configuration takes effect.
Examples
# Configure the sender's email address as [email protected].
<Sysname> system-view
[Sysname] send-email type warning
[Sysname-email-warning] email-sender [email protected]
email-sending enable
Use email-sending enable to enable email sending.
Use undo email-sending enable to disable email sending.
Syntax
email-sending enable
undo email-sending enable
Default
Email sending is disabled.
Views
Email view
Predefined user roles
network-admin
context-admin
Examples
# Enable email sending.
<Sysname> system-view
[Sysname] send-email type warning
[Sysname-email-warning] email-sending enable
email-server (email view)
Use email-server to specify the SMTP server to send alert emails.
Use undo email-server to restore the default.
Syntax
email-server server-name
undo email-server server-name
Default
No SMTP server is specified.
Views
Email view
Predefined user roles
network-admin
context-admin
Parameters
server-name: Specifies an SMTP server by its name, a case-insensitive string of 1 to 63 characters.
Usage guidelines
If you execute this command multiple times, the most recent configuration takes effect.
Examples
# Specify SMTP server smtp-server1 to send alert emails.
<Sysname> system-view
[Sysname] send-email type warning
[Sysname-email-warning] email-server smtp-server1
email-server (system view)
Use email-server to create an email server and enter its view, or enter the view of an existing email server.
Use undo email-server to delete an email server.
Syntax
email-server server-name
undo email-server server-name
Default
No email servers exist.
Views
System view
Predefined user roles
network-admin
context-admin
Parameters
server-name: Specifies an email server name, a case-insensitive string of 1 to 63 characters.
Examples
# Create an email server named smtp-server1 and enter its view.
<Sysname> system-view
[Sysname] email-server smtp-server1
[Sysname-email-server-smtp-server1]
email-server client-authentication enable
Use email-server client-authentication enable to enable client authentication.
Use undo email-server client-authentication enable to disable client authentication.
Syntax
email-server client-authentication enable
undo email-server client-authentication enable
Default
Client authentication is disabled.
Views
Email server view
Predefined user roles
network-admin
context-admin
Usage guidelines
To authenticate users who attempt to log in to the email server, enable client authentication.
If you enable client authentication, you must configure the username and password for login authentication.
Examples
# Enable client authentication on email server smtp-server1.
<Sysname> system-view
[Sysname] email-server smtp-server1
[Sysname-email-server-smtp-server1] email-server client-authentication enable
Related commands
email-server username
email-server host
Use email-server host to specify the IP address or domain name of the email server.
Use undo email-server host to restore the default.
Syntax
email-server host { domain domain-name | ip ip-address }
undo email-server host
Default
The IP address or domain name of the email server is not specified.
Views
Email server view
Predefined user roles
network-admin
context-admin
Parameters
domain domain-name: Specifies the domain name, a dot-separated, case-insensitive string of 1 to 253 characters. Each dot-separated label in the domain name can contain a maximum of 63 characters. The domain name can contain letters, digits, hyphens (-), underscores (_), and dots (.).
ip ip-address: Specifies the IPv4 address.
Usage guidelines
If you specify a domain name, you must configure DNS to obtain the mapping between the domain name and IP address of the email server. For more information about DNS, see Layer 3—IP Services Configuration Guide.
Examples
# Specify the IPv4 address of the email server as 192.168.1.1.
<Sysname> system-view
[Sysname] email-server smtp-server1
[Sysname-email-server-smtp-server1] email-server host ip 192.168.1.1
Related commands
dns server (Layer 3—IP Services Command Reference)
email-server port
Use email-server port to specify the port number of the email server.
Use undo email-server port to restore the default.
Syntax
email-server port port
undo email-server port port
Default
The port number of the email server is 25.
Views
Email server view
Predefined user roles
network-admin
context-admin
Parameters
port: Specifies the port number in the range of 1 to 65535.
Examples
# Specify the port number of the email server as 7025.
<Sysname> system-view
[Sysname] email-server smtp-server1
[Sysname-email-server-smtp-server1] email-server port 7025
email-server test
Use email-server test to test the availability of the email server.
Syntax
email-server test
Views
Email server view
Predefined user roles
network-admin
context-admin
Usage guidelines
This command sends a test email to test the availability of the email server.
If the email server is available, the message Email server is available is returned. If the email server is unavailable, the message Email server is not available is returned.
Examples
# Test the availability of email server smtp-server1.
<Sysname> system-view
[Sysname] email-server smtp-server1
[Sysname-email-server-smtp-server1] email-server test
email-server username
Use email-server username to configure the username and password used by the email server to authenticate the device.
Use undo email-server username to restore the default.
Syntax
email-server username username password { cipher | simple } password
undo email-server username
Default
The username and password are not configured.
Views
Email server view
Predefined user roles
network-admin
context-admin
Parameters
username: Specifies the username, a case-sensitive string of 1 to 63 characters. The username cannot these special characters: ampersand (&), vertical bar (|), double quotation mark ("), single quotation mark ('), comma (,), colon (:), percent sign (%), left angle bracket (<), right angle bracket (>), forward slash (/), and backslash (\).
password: Specifies the password.
cipher: Specifies the password in encrypted form.
simple: Specifies the password in plaintext form. For security purposes, the password specified in plaintext form will be stored in encrypted form.
password: Specifies the password string. Its plaintext form is a case-sensitive string of 1 to 63 characters. Its encrypted form is a case-sensitive string of 1 to 117 characters.
Usage guidelines
If you execute this command multiple times, the most recent configuration takes effect.
Examples
# Configure the login username and password as admin and abc123.
<Sysname> system-view
[Sysname] email-server smtp-server1
[Sysname-email-server-smtp-server1] email-server username admin password simple abc123
Related commands
email-server client-authentication enable
email-subject
Use email-subject to configure the email subject.
Use undo email-subject to restore the default.
Syntax
email-subject subject-string
undo email-subject
Default
The email subject is not configured.
Views
Email view
Predefined user roles
network-admin
context-admin
Parameters
subject-string: Specifies the email subject, a case-sensitive string of 1 to 255 characters. The email subject cannot these special characters: ampersand (&), vertical bar (|), double quotation mark ("), single quotation mark ('), comma (,), colon (:), percent sign (%), left angle bracket (<), right angle bracket (>), forward slash (/), and backslash (\).
Examples
# Configure the email subject as test.
<Sysname> system-view
[Sysname] send-email type warning
[Sysname-email-warning] email-subject test
event
Use event to specify an event type that triggers alerts.
Use undo event to delete an event trigger.
Syntax
event { link-failure | network-attack | node-failure }
undo event { link-failure | network-attack | node-failure }
Default
No event trigger is specified.
Views
Email view
Predefined user roles
network-admin
context-admin
Parameters
link-failure: Specifies the link failure event type. When a link fails or recovers from a failure, an alert email is sent.
network-attack: Specifies the network attack event type. When a network attack is detected, an alert email is sent.
node-failure: Specifies the node failure event type. When a node fails or recovers from a failure, an alert email is sent.
Usage guidelines
You can execute this command multiple times to specify event triggers.
Examples
# Specify the node failure event type that triggers alerts.
<Sysname> system-view
[Sysname] send-email type warning
[Sysname-email-warning] event node-failure
send-email
Use send-email to create and enter the email view.
Use undo send-email to delete all settings in email view.
Syntax
send-email type warning
undo send-email type warning
Default
No email view exists.
Views
System view
Predefined user roles
network-admin
context-admin
Parameters
type warning: Specifies the warning type.
Examples
# Create and enter the email view of the warning type.
<Sysname> system-view
[Sysname] send-email type warning
[Sysname-email-warning]