Email Service Monitoring
Last updated on 22 November, 2024LogicMonitor offers email service monitoring for health metrics, including round-trip time and transit time.
Requirements
- Install the email service LogicModules. For more information, see Email Service LogicModules.
- Review Microsoft 365 OAuth Email Monitoring.
- Review Gmail OAuth Email Monitoring.
Adding Monitoring for Email Round-Trip Time
- From the LogicMonitor Resources page, navigate to the resource that you want to monitor.
- Select the Info tab and then select Settings.
- Add
email_rtt
as a value to thesystem.categories
property. For more information, see Resource and Instance Properties. - Add the following email service connectivity information as custom properties for the resource:
Property | Value | Example | Required |
---|---|---|---|
smtp.host | Hostname of the SMTP service | smtp.gmail.com | Yes |
smtp.type | SMTP security type: blank/SSL/TLS | SSL | Yes |
imap.host | Hostname of the IMAP service | imap.gmail.com | Yes |
imap.type | IMAP security type: blank/SSL/TLS/OAuth | TLS | Yes |
email.user or gmail.client.id | User or Client ID required for account authentication | testuser | Yes |
email.pass or gmail.client.secret.pass | Password or Client Secret required for account authentication | hello123 | Yes |
email.addr | The email address for the account | [email protected] | Yes |
email.folder.name | The folder name emails will appear in. | Inbox | No |
Note: Measurements are taken from the perspective of the collector that is assigned to monitor the resource. Messages are sent and retrieved from the device’s collector, and not the device itself. You can apply the DataSource to the server that the Collector is installed on (if it has been added into monitoring), or you can apply the DataSource to any other monitored device.
Adding Monitoring for Email Transit Time
- Navigate to the resource that you want to monitor.
- Select the Info tab and then select Settings.
- Add
email_transit
to thesystem.categories
property. For more information, see Resource and Instance Properties. - Add the following custom properties for the email services that you’re monitoring. For example, if you’re measuring email transit time between a Gmail account and a Microsoft Office 365 (O365) account:
Service | Property | Value | Description | Example |
---|---|---|---|---|
Gmail | transit.gmail.imapHost | IMAP hostname | Gmail retrieval | imap.gmail.com |
Gmail | transit.gmail.imapType | IMAP encryption type | Gmail retrieval | SSL (port 993) |
Gmail | transit.gmail.smtpHost | SMTP hostname | Gmail delivery | smtp.gmail.com |
Gmail | transit.gmail.smtpType | Encryption type for SMTP service | Gmail delivery | Blank (port 25) SSL (port 465) TLS (port 587) |
Gmail | transit.gmail.addr | Email address for the Gmail account | [email protected] | |
Gmail | transit.gmail.user | User ID | User ID for the Gmail account | [email protected] |
Gmail | transit.gmail.pass | Password | Password for the Gmail account | P@ssw0rd |
O365 | transit.o365.imapHost | IMAP hostname | O365 retrieval | imap.o365.com |
O365 | transit.o365.imapType | IMAP encryption type | O365 retrieval | SSL (port 993) |
O365 | transit.o365.smtpHost | SMTP hostname | O365 delivery | smtp.o365.com |
O365 | transit.o365.smtpType | Encryption type for SMTP service | O365 delivery | Blank (port 25) SSL (port 465) TLS (port 587) |
O365 | transit.o365.addr | Email address | Email address for the O365 account | [email protected] |
O365 | transit.o365.user | User ID | User ID for the O365 account | [email protected] |
O365 | transit.o365.pass | Password | Password for the O365 account | P@ssw0rd |
Note: A key is the section of the property that identifies the service. For example, transit.gmail.smtpHost. These must be consistent across each service.
Adding Monitoring Instances for Email Transit Time
To monitor email transit time, create instances for each transit direction.
- From the LogicMonitor Resources page, navigate to the
Email_TransitTime
DataSource. - From the Manage Device menu, select Add Monitored Instance.
- From the Add Monitored Instance page, enter the Name and Wildvalue information, based on the following example:
- Name: Gmail > O365
- Wildvalue (sender:receiver): gmail:o365
- Instance Group: @default
- Select Save.
- Return to the Resources page and create a second monitored instance for the
Email_TransitTime
DataSource, based on the following example:- Name: O365 > Gmail
- Wildvalue (sender:receiver): o365:gmail
- Instance Group: @default
- Select Save.
Note: In the Wildcard Value field, the colon-separated keys must match the keys used to represent the sending and receiving services.
Sample Evaluation Process for Email Transit Time
The process for evaluating Email Transit Time, using Gmail and Office 365 as an example:
Step | Protocol | Description | Example |
1 | SMTP | Deliver a message from the collector to Provider A. | Collector > Gmail |
2 | SMTP | Provide a destination address to Provider B. | Gmail > Office 365 |
3 | IMAP | Get the message back to the collector. | Office 365 > Collector |
This process highlights two components of email service monitoring:
- The time it takes messages sent from an email server to be delivered externally.
- The time it takes messages sent externally to make it to an inbox.
Note: The Email Transit Time DataSource contains an ErrorCode datapoint to show where any errors may have occurred.
Error Codes
The applicable error codes are as follows:
Error Code | Meaning | Description |
---|---|---|
-2 | Invalid instance | Unable to locate a valid service. |
-1 | Missing params | Basic parameters, such as username and password, were not available to properly validate transit time. |
0 | OK | The roundtrip validation was successful. |
1 | SMTP connection failure | The collector can not connect to the SMTP server. |
2 | SMTP send failure | Connected to the SMTP server and attempted to send a message, but the server did not accept the message. |
3 | IMAP connection failure | Unable to connect to the destination server hosting the inbox that contains the message. Typically due to an incorrect hostname, user ID, or password. Or, the specified security type is incorrect. |
4 | IMAP search failure | Unable to retrieve the unique message at the destination server.Note: Each time the Email_TransitTime DataSource runs, it generates a message with a unique subject line. In order to validate the round-trip/transit time, the message must be retrieved from the IMAP server. Recommendation: Turn off any filters that auto delete incoming emails. |
5 | IMAP close failure | Unable to properly terminate the IMAP connection. |
Diagnostic Logs
Diagnostic logs for DataSources are enabled by default, and can be found in the collector’s logs directory:
/usr/local/logicmonitor/agent/logs
C:\Program Files (x86)\LogicMonitor\Agent\logs
Logs | Stored As | Description |
---|---|---|
Protocol | Email Round-Trip Time:[hostname]-emailRTT-protocol.log Email Transit Time:[hostname]-[instance]-emailTransit-protocol.log | Protocol logs show the underlying SMTP and IMAP commands issued by the collector and the corresponding responses by the target server(s).Note: These may require advanced level understanding of SMTP and IMAP protocols. |
Debug | Email Round-Trip Time:[hostname]-emailRTT-debug.log Email Transit Time:[hostname]-[instance]-emailTransit-debug.log | Debug logs show telemetry of the DataSource itself, indicating what steps have been attempted, succeeded or failed. |
Email Service LogicModules
The email service monitoring DataSources are Email Round-Trip Time and Email Transit Time. For more information, see Installing Modules and Packages.
Name | Type | Description |
---|---|---|
Email_RoundTrip | DataSource | Measures the time taken to deliver a given message from the collector to an SMTP service, along with the time to retrieve the same message from the corresponding IMAP service. The LogicMonitor collector acts as a desktop email client:Sends outgoing messages using your SMTP service.Retrieves that same message from your IMAP service.The time to complete each step in the round-trip transaction is measured and reported. For example, any latency within your network or in the message handoff between your SMTP service, message store, and IMAP service. |
Email_TransitTime | DataSource | Measures the time taken to collect an email sent from one service to another. This can help to determine whether your email service is properly delivering and accepting messages from other service providers. Email Transit Time uses two protocols:SMTP to send messages from a client to a server.IMAP to retrieve messages from the server to a client. |
Office365_Email_OAUTH | DataSource | Check for and gathers tokens for Office 365 OAuth. Requires application registration and credentials set:office365.clientidoffice365.clientsecret.passoffice365.tenantidFor more information, see Microsoft 365 OAuth Email Monitoring. |