Manual Chapter :
Email Notifications SMTP
Applies To:
Show VersionsARX
- 6.3.0
The SMTP mail queue holds email messages until they are successfully delivered. Use the clear smtp queue command to delete all such queued messages. | |
Messages are only in the mail queue for a very short time before the first attempt to deliver them. If you can see a message with show smtp queue, the message has not yet been successfully delivered. Use this command to delete all messages from the queue. Use show smtp status to see details on the most-recent message delivery, and to view the current configuration for SMTP. | |
bstnA# clear smtp queue | |
Use the optional description command to set a descriptive string for the current email-event role. An email event role is a configurable list of SNMP traps, along with a group of users who receive email notifications for those traps. This appears in the show command. Use the no form of the command to delete the description. | |
description text text (1-255 characters) is your description. Surround the text with quotation marks ( ) if it contains any spaces. | |
bstnA(cfg-email-event[noc3])# description support team at NOC3 | |
Use the email-event command to start defining a set of ARX events to be emailed, the conditions under which the switch sends the email(s), and any recipients who should receive them. This creates a profile, or role, for one or more users who require event notification. Use no email-event to remove an email event role. | |
email-event role no email-event role role (1-128 characters) is a name that you choose for this set of email events, trigger conditions, and mail recipients (for example, nocGroup). | |
This command places you in cfg-email-event mode, where you can access several commands that define the email event role. To enable groups of events at a time, use the group (cfg-email-event) command. You can also use this command to set thresholds or schedules for email notification (for example, send for every 3 occurrences of a group event, or once each week). You can enable individual events with the group ... event command, which can also override any default-threshold settings made for the events group. The mail-to (cfg-email-event) command chooses an email recipient for this set of events; enter this command once for each desired recipient. You can use the description (cfg-email-event) command to add an optional description to the email event configuration; this appears in the output of show email-event. Use enable (cfg-email-event) to enable all of the rules in this email event configuration. Notification does not begin until you enable the email event role. You can reuse the email-event command to define multiple email event roles. Email messages have a field in the SMTP header where you can set a severity level. SMTP servers can use this field for sorting and flagging incoming messages; the server at F5 Support is configured to use this field for prioritizing customer issues. Use the email-severity command to set the email severity for a given event. The show email-severity command shows event severities. To send a small test message to all configured email recipients, use the smtp test email-event command. After a successful test, you can use smtp welcome to send an introductory email to all of the recipients. This email delivery mechanism can be used together with standard SNMP-trap delivery. Use snmp-server traps to start setting up SNMP traps. | |
bstnA(cfg)# email-event noc3 bstnA(cfg)# no email-event testEmail | |
You can use the email-event feature to send emails to one or more users (possibly including F5 Support) for certain SNMP traps. A field in the SMTP-message header contains the severity for the message. This field is not shown in most email applications, but email servers can use it for prioritization. Use the email-severity command to modify the email severity for a particular event. Use no email-severity to revert to a default email severity. | |
email-severity event-name level {normal | warn | minor | major | critical} no email-severity event-name event-name (1-64 characters) identifies an event. An event corresponds to one SNMP trap, cataloged in the ARX SNMP Reference. Use a ? after the email-severity keyword for a full list of eligible email events (for example, email-severity ?). normal | warn | minor | major | critical sets the severity for the events email messages. | |
Use show email-severity to show the current severities for one or more events. | |
bstnA(cfg)# email-severity auto-reboot level critical bstnA(cfg)# no email-severity disk-state | |
You can define one or more SNMP-trap events to be emailed to one or more users, as well as the thresholds for sending each event. One collection of events, thresholds, and users is called an email event role. Use the enable command to activate the current role. Use no enable to disable the current email event role. | |
bstnA(cfg-email-event[betaTest])# no enable | |
Use the from command to set the From field in all email messages from the ARX. Use no from to revert to the default From string. | |
hostname@domain is 1-132 characters (for example, admin@arx1000-B.nemed.com). Use only alphabetical characters (a-z and A-Z), numeric characters (0-9), - (dash), _ (underscore), and/or . (period). | |
The string you set with this command appears in the header of all email messages, in the From field. Enter an email address that uses acceptable characters (listed above in Syntax). If there are any invalid characters, the CLI rejects the string with an error. | |
bstnA(cfg-smtp)# from aco_admin@acopia.wwmed.com bstnA(cfg-smtp)# no from | |
You can define SNMP-trap events to be emailed to one or more users, as well as the thresholds for sending each event. One collection of events, thresholds, and users is called an email event role. Use the group command to add an entire group of events to an email event role. Use the no form to remove a group of events from a role. | |
group-name is chassis, cifs, storage, metadata, nsck, policy, snapshot, stats-monitor, virtual-server, network, redundancy (for any chassis except the ARX-VE), or all. threshold-counter counter (optional, 1-128) sets a threshold based on the number of events that occur from this group. For example, threshold-counter 4 means that each event from this group triggers an email if it occurs 4 times. threshold-interval time {minutes | hours | days} (optional) sets a schedule for this group. For example, threshold-interval 1 days causes the system to accumulate traps throughout the day and, if there are any, send a single email describing all of them. All time calculations begin when you enter this configuration; if the threshold interval is 1 day, the switch sends the email at the current time of day. | |
If you enable a group without setting any threshold, the default is threshold-counter 1. | |
You cannot choose the redundancy group on the ARX-VE. | |
This command enables one group of events for the current email event role. Whenever the system reaches a threshold you set with this command, it sends an email to any or all mail-to (cfg-email-event) recipients. You can optionally use the group ... event command to configure a single event in the group, or to set a different threshold for a particular event. The system keeps a maximum of 128 events for any event group. This is a hard threshold, even if you use the threshold-interval option to create a time-based schedule. For example, suppose you configure the following: If you use group ... event to add a specific event, the no group command for its group does not delete that event. For example, the following command sequence does not delete the warmstart event: | |
bstnA(cfg-email-event[noc3])# group chassis bstnA(cfg-email-event[noc3])# group metadata threshold-counter 5 bstnA(cfg-email-event[noc3])# no group storage | |
You can define one or more SNMP-trap events to be emailed to one or more users, as well as the thresholds for sending each event. One collection of events, thresholds, and users is called an email event role. Use the group ... event command to add one event to an email event role. | |
group group-name event event-name [threshold-counter counter | threshold-interval time {minutes | hours | days}] no group group-name event event-name [threshold-counter counter | threshold-interval time {minutes | hours | days}] group-name is chassis, cifs, storage, metadata, nsck, policy, snapshot, stats-monitor, virtual-server, network, redundancy (for any chassis except the ARX-VE), or all. event-name (1-64 characters) is one of the events in the group. Each of these corresponds to one SNMP trap, cataloged in the ARX SNMP Reference. Use a ? after the event keyword for a full list of events in this group (for example, group chassis event ?). threshold-counter counter (optional, 1-128) sets a threshold based on the number of times this event occurs. For example, threshold-counter 4 means that any four occurrences trigger an email. threshold-interval time {minutes | hours | days} (optional) sets a schedule for this event. For example, threshold-interval 1 days causes the system to accumulate instances of this event throughout the day and, if there are any, send a single email describing all of them. All time calculations begin when you enter this configuration; if the threshold interval is 1 day, the switch sends the email at the current time of day. | |
You cannot choose the redundancy group on the ARX-VE. | |
This command enables one event for the current email event role. Whenever the system reaches its threshold for this event, it sends an email to any or all mail-to (cfg-email-event) recipients for this role. If you do not set any threshold for an event, its group threshold is used (as set by the group (cfg-email-event) command). The no form of the command disables the events threshold (so that the event defaults to the threshold for its group), or removes the event altogether. See the Samples, below. | |
bstnA(cfg-email-event[noc3])# group metadata event online threshold-counter 2 bstnA(cfg-email-event[testteam])# group virtual-server event server-offline bstnA(cfg-email-event[noc3])# no group metadata event online threshold-counter 2 bstnA(cfg-email-event[noc3])# no group chassis event cpu-status | |
The mail-server command identifies the next-hop email server for the ARX. Use no mail-server to delete the email server name. | |
mail-server ip-or-name ip-or-name (1-132 characters) identifies the mail server, either by IP address or DNS name (for example, 192.168.25.44 or mailServer3.myco.com). | |
You must have a DNS server configured to use a DNS name in this command. Refer to the ip name-server documentation to configure a DNS server. To see the currently configured mail server, use the show smtp status command. To test the mail-server configuration, use the smtp test server command. | |
bstnA(cfg-smtp)# mail-server email1.wwmed.com | |
You can define one or more SNMP-trap events to be emailed to one or more users, as well as the thresholds for sending each event. One collection of events, thresholds, and users is called an email event role. Use the mail-to command to set one destination address for the current roles emails. Use the no mail-to command to remove an email recipient. | |
mail-to recipient no mail-to recipient recipient (1-768 characters) is one email recipient (for example, juser@nemed.com). | |
A sample email appears in Figure 13.1 on page 13-15. You can use the ID (highlighted in the sample) to look up the trap in the ARX SNMP Reference. | |
bstnA(cfg-email-event[noc3])# mail-to juser@wwmed.com bstnA(cfg-email-event[noc3])# no mail-to ex@nemed.com | |
Figure 13.1 Sample Email Event
When the ARX fails to deliver an email message, it retries periodically. If the failures persist for too long, the ARX deletes the message. Use the maximum age command to determine the maximum amount of time to retry before deleting the message. Use no maximum age to return to the default. | |
maximum age days days (1-366) is the number of days to retry before deleting the message. | |
The ARX retries a message every n minutes for the first two hours; you can use retry interval to set the value of n. The retry interval increases geometrically if the failures persist. After some number of days without success (set by this command, maximum age), the switch deletes the message from the mail queue. Use show smtp queue to view all messages currently in the mail queue. These are the messages that have failed and are being saved for retries. You can use smtp retry to retry all queued messages now. The clear smtp queue command deletes all the messages without sending them. | |
bstnA(cfg-smtp)# maximum age 30 bstnA(cfg-smtp)# no maximum age | |
When the ARX fails to deliver an email message, it waits for some number of minutes before retrying. Use the retry interval command to set the initial interval between retries. Use no retry interval to return to the default interval. | |
retry interval minutes minutes (1-119) is the number of minutes to wait between email retries. | |
The ARX retries a message every n minutes for the first two hours; this command sets the value of n. The retry interval increases geometrically if the failures persist. After some number days without success (set by maximum age), the switch deletes the message from the mail queue. Use show smtp queue to view all messages currently in the mail queue. These are the messages that have failed and are being saved for retries. You can use smtp retry to retry all queued messages now. The clear smtp queue command deletes all the messages without sending them. | |
bstnA(cfg-smtp)# retry interval 10 bstnA(cfg-smtp)# no retry interval | |
You can define one or more SNMP-trap events to be emailed to one or more users, as well as the thresholds for sending each event. One collection of events, thresholds, and users can be applied to technicians with a certain role. Use the show email-event command to see the configuration for one or all email event roles. | |
show email-event {role-name | all} role-name (1-128 characters) is one role (for example, tech-support). all selects all roles. | |
SMTP shows a summary of the SMTP settings for this ARX: From is used in the From field of all emails. You can set this with from (cfg-smtp). Local Mail Server is the SMTP server that is the next hop for all emails. You can set this with mail-server. Email Event describes the configuration of one email-event role: Role is the name of the email-event role, set with the email-event command. Description shows the optional description for this role. You can use the description (cfg-email-event) command to set (or change) this description. To is a comma-separated list of email recipients. You can add one with the mail-to (cfg-email-event) command. Admin State shows whether or not this role is enabled. Use enable (cfg-email-event) to enable the role. Group Name is set with the group (cfg-email-event) command. Threshold Counter is either a number or n/a. If this many events from the group occur, the system sends an email. This is set with the threshold-counter option in the above group command. Threshold Interval (every) is either time value (such as 2 hours or 7 days) or n/a. If any events from the group occur during this time, the system sends an email at the end of the time interval. This is set with the threshold-interval option in the group command. | |
Group Name is set with the group ... event command. Event Name is set with the same command. Threshold Counter is either a number or n/a. If this many instances of the event occur, the system sends an email. This is set with the threshold-counter option in the group ... event command. Threshold Interval (every) is either time value (such as 10 minutes or 12 hours) or n/a. If any instances of this event occur during this time, the system sends an email at the end of the time interval. This is set with the threshold-interval option in the group ... event command. | |
bstnA# show email-event all shows all email event roles. See Figure 13.2 on page 13-19 for sample output. bstnA# show email-event noc3 shows the configuration for one email event role. See Figure 13.3 on page 13-20 for sample output. | |
Figure 13.2 Sample Output: show email-event all
bstnA# show email-event all
Figure 13.3 Sample Output: show email-event noc3
bstnA# show email-event noc3
Figure 13.4 Sample Output: show email-severity all
bstnA# show email-severity all
Figure 13.5 Sample Output: show email-severity non-default
bstnA# show email-severity non-default
bstnA# show email-severity nvram-battery-failure
Use the show smtp queue command to see the email messages that are queued for delivery, if any. | |
Status is pending, to indicate that the message is waiting for final delivery. From can be reset (for future emails) with from (cfg-smtp). Size is in bytes if no unit (K, M, G, or T) appears after the number. K is for KiloBytes (1024 bytes), M is for MegaBytes (1024*1024 bytes), and so forth. Time is when the message was created. The ARX retries a message every few minutes (set by retry interval) for the first two hours. This retry interval increases geometrically if the failures persist. After some days without success (set by maximum age), the switch deletes the message from the mail queue. You can use smtp retry to retry all queued messages now. The clear smtp queue command deletes all the messages without sending them. | |
Use show smtp status to see details on the most-recent message delivery, and to view the current configuration for SMTP. | |
bstnA# show smtp queue shows the queue of pending email messages, if any. See Figure 13.7 for sample output. | |
Figure 13.7 Sample Output: show smtp queue
bstnA# show smtp queue
Use the show smtp status command to see the status of the most recent outbound email, as well as all SMTP-configuration settings. | |||||||||||||
SMTP Last Transfer shows the last email message that was collected for delivery. This is not the most-recent retry; it is the most-recent message (or test) that was generated. Last file is the file name and size for the attachment file. Status shows the status of the most-recent delivery:
| |||||||||||||
Message Created is the time when the message was first generated. SMTP Current Configuration shows the configuration that is in effect. This configuration will be applied to current and future email messages. From can be set with from (cfg-smtp). Via is the SMTP server that is the next hop for all emails. You can set this with mail-server. Retry Interval is the time between retries for messages in the mail queue. The ARX uses this interval for the first two hours, then starts using larger intervals if the failures persist. You can set this initial interval with the retry interval command. Maximum Age is maximum number of days to keep a message in the mail queue before deleting it. Use maximum age to set this value. Use show smtp queue to see any pending email messages. To send a test message, use smtp test message. If messages are failing, you can run smtp test server to test SMTP communication with the local email server. | |||||||||||||
bstnA# show smtp status shows the SMTP status for the current switch. See Figure 13.8 for sample output. | |||||||||||||
Figure 13.8 Sample Output: show smtp status
bstnA# show smtp status
You can use the smtp welcome command to send an introductory email to all users of an email-event role. Use the show smtp welcome command to see the welcome message for this introductory email. | |
bstnA# show smtp welcome shows the outline of the welcome message. The <EMAIL_EVENT_ROLE> variable is replaced by the roles name (set with email-event), and the <HOSTNAME> is replaced by the ARXs host name (set with hostname). | |
The ARX uses the Simple Mail Transfer Protocol (SMTP) to send email messages to other machines. Use the smtp command to begin SMTP configuration. Use no smtp to erase all SMTP configuration parameters and disable email notifications. | |
You must configure DNS for the SMTP service to work. See the instructions for ip name-server. You must have layer-2 and layer-3 connectivity to your server network(s) before DNS or SMTP can function. Use this command to enter cfg-smtp mode, where you set up the necessary parameters for email. You can use from (cfg-smtp) to set the From field in all out-bound emails (for example, From: hostname@domain). The mail-server command identifies the local mail server to be used as the next hop for mail messages. Use the to command to set one or more destinations for emails. If an email delivery fails, it retries at the frequency set by retry interval, up to a maximum number of days (maximum age). After the maximum age expires, the ARX deletes the message. | |
To send a test message, use smtp test message reply-to with a local destination for the message. You can view any undelivered messages with the show smtp queue command. Use the smtp retry and clear smtp queue commands to manage this mail queue. If messages are consistently failing, you can run smtp test server to test SMTP communication with the local email server. | |
After you finish configuring SMTP, you can configure certain system events to be delivered in email messages. Each event is analogous to an SNMP trap; see the ARX SNMP Reference for a full list of ARX Enterprise traps, including the traps that have email support. You can choose individual events or groups of them, one or more email recipients for the events, and thresholds (or a schedule) for sending the emails. All of these components can be assigned to technicians who perform a specific role. Use the email-event command to begin configuring one such role. You can create multiple roles by re-using this command. SMTP is also useful for sending collected diagnostics and other maintenance files over email. After you configure SMTP, use the collect command to collect and send diagnostics. You can also use copy smtp to send log files, reports, or other files that could be useful for maintenance. | |
bstnA(cfg)# smtp bstnA(cfg-smtp)# ... bstnA(cfg)# no smtp | |
The SMTP mail queue holds email messages until they are successfully delivered. Use the smtp retry command to retry all queued messages at once. | |
This is particularly useful if there was a network problem between the ARX and the next-hop mail server (mail-server). After you fix the network problem, you can use this command to re send all queued messages. You can use show smtp queue to see the mail queue before and after the retry. As an alternative, you can use clear smtp queue to remove all messages from the queue. When you change a parameter in cfg-smtp mode (see smtp) and then exit the mode, the ARX automatically retries all messages in the queue using the new parameters. There is no need to invoke this command under these circumstances. Use show smtp status to see details on the most-recent message delivery, and to view the current configuration for SMTP. | |
bstnA# smtp retry | |
Use the smtp test email-event command to test an email-event configuration. This sends a test email to all configured recipients. | |
smtp test email-event role-name role-name (1-128 characters) is the role to test (for example, tech-support). Use show email-event all for a list of all configured email-event roles. | |
Use this command to send an email message with a small test attachment. the message goes to all mail-to (cfg-email-event) recipients configured for the chosen email-event role. Use show email-event role-name to see all recipients for a given role. You can use this to verify the email-event configuration and SMTP setup. If the message is successfully delivered to the next-hop mail-server, a message appears similar to the following: An error appears if there is a delivery problem. In this case, you can use show smtp queue to see the test message in the mail queue. To retry the message (perhaps after correcting the network configuration), use smtp retry. Use clear smtp queue to remove all messages from the queue. If the delivery problems persist, you can run an SMTP diagnostic test, smtp test server, and send the output back to F5 for analysis. Note that the test message has a small attachment, so this does not test any errors that may come up with large attachments. An attachment from copy smtp or collect can be hundreds of MegaBytes. Use show smtp status to see details on the most-recent message delivery, and to view the current configuration for SMTP. After a successful test, you can use the smtp welcome command to send a welcome message to all email recipients. This message informs the recipients of the events that will trigger email messages in the future. | |
bstnA# smtp test email-event noc3 | |
Figure 13.9 Sample Email from smtp test email-event
Use the smtp test message command to send a test email message. | |
The message is delivered to the next-hop mail-server. An error appears if there is a delivery problem. In this case, or if no reply email arrives for 15 minutes or more, you can use show smtp queue to see the test message in the mail queue. Also, check the email filter at the destination mailbox. To retry the message (perhaps after correcting the network or filter configuration), use smtp retry. Use clear smtp queue to remove all messages from the queue. If the delivery problems persist, you can run an SMTP diagnostic test, smtp test server, and send the output back to F5 for analysis. Note that the test message has a small attachment, so this does not test any errors that may come up with large attachments. An attachment from copy smtp or collect can be hundreds of MegaBytes. Use show smtp status to see details on the most-recent message delivery, and to view the current configuration for SMTP. | |
bstnA# smtp test message reply-to jsmith@wwmed.com | |
At the advice of F5 personnel, use the smtp test server command to test the SMTP-layer connection to the email server. | |
This command runs a series of STMP queries against the next-hop mail-server. After you enter this command, the CLI shows the detailed results of this test. Run the test when you see email delivery problems. If the SMTP queue has undelivered messages in it (show smtp queue), or if smtp test message fails, you should run this test. Send the results back to F5 for further diagnosis. | |
bstnA# smtp test server tests the connection to the next-hop email server. See Figure 13.10 for sample output. | |
Figure 13.10 Sample Output: smtp test server
bstnA# smtp test server
Use the smtp welcome command to send an introductory email message to all users in an email-event configuration. The introductory message informs the recipients of the types of system events they will be receiving through email. | |
smtp welcome [role-name] role-name (optional, 1-128 characters) is the role to receive the email message (for example, noc_7). Use show email-event all for a list of all configured email-event roles. | |
role-name defaults to all roles if you omit it. That is, the command sends a welcome message to all users in all email-event roles. | |
Use this command to send an introductory email message to the recipients of email events. the message goes to all mail-to (cfg-email-event) recipients configured for the chosen email-event role (or all roles, if no specific role was selected). Use show email-event role-name to see all recipients for a given role. If the message is successfully delivered to the next-hop mail-server, a message appears similar to the following: Use show smtp status to see details on the most-recent message delivery, and to view the current configuration for SMTP. If the message fails, you can use smtp test email-event to test the email-event configuration and SMTP setup. The email contains a welcome message and two tables to outline the types of events that the recipient can expect in email messages. The top table shows event groups, and the bottom table contains individual events that will trigger an email. The show smtp welcome command shows the format of the welcome message. | |
bstnA# smtp welcome noc3 | |
Figure 13.11 Sample Email from smtp welcome
Use the to command to set destination address(es) for emails from the ARX. Use the no to command to revert to the default destination. | |
to destination-list destination-list (1-1024 characters) is a comma-separated list of email recipients (for example, juser@nemed.com or jqpublic@wwmed.com,juser@nemed.com). Surround this field with quotation marks if it contains any spaces. | |
This sets the destination(s) for emails from the ARX; these addresses appear in the To field of the emails. These addresses only apply to emails from collect, copy smtp, and smtp test message. Each email-event role has its own set of email recipients, configured with the mail-to (cfg-email-event) command. | |
bstnA(cfg-smtp)# to juser@das1.wwmed.com,e-support@f5.com bstnA(cfg-smtp)# no to | |