healthchecks_healthchecks/templates/docs/email.html-fragment
2024-02-15 13:17:24 +02:00

44 lines
2.9 KiB
Plaintext

<h1>Email</h1>
<p>Alternatively to HTTP/HTTPS requests, you can "ping" checks by
sending email messages to special email addresses.</p>
<p><img alt="Email address for pinging via email" src="IMG_URL/emails.png" /></p>
<h2 id="keyword-filtering">Keyword Filtering</h2>
<p>By default, SITE_NAME will consider any email received at the displayed address as
a "success" signal. Optionally, you can configure SITE_NAME to look for specific
keywords in the subject line or the message body to decide if the message
is a "start," a "success," or a "failure" signal.</p>
<p>SITE_NAME treats keywords as case-sensitive (for example, "Error" and "error" are
different keywords), and matches them in a specific order:</p>
<ul>
<li>SITE_NAME first checks the message for presence of any <strong>failure</strong> keyword.</li>
<li>It then checks for any <strong>success</strong> keyword.</li>
<li>It then checks for any <strong>start</strong> keyword.</li>
<li>If filtering is enabled but none of the keywords match, SITE_NAME <strong>ignores</strong>
the email message. The email will show in the event log with an "Ignored" badge.</li>
</ul>
<p>You can set up keywords in the <strong>Filtering Rules</strong> dialog:</p>
<p><img alt="Setting filtering rules" src="IMG_URL/filtering_rules.png" /></p>
<h2>Use Case: Newsletter Delivery Monitoring</h2>
<p>Consider a cron job that runs weekly and sends newsletters
to a list of email addresses. You have already set up a check to get alerted
when your cron job fails to run. But you ultimately want to check if
<strong>your emails are getting sent and delivered</strong>.</p>
<p>The solution: set up another check, and add its email address to your list of
recipient email addresses. Set its Period to 1 week. As long as your weekly email
script runs correctly, and there are no email delivery issues,
SITE_NAME will regularly receive an email, and the check will stay up.</p>
<h2>Use Case: Backup Monitoring</h2>
<p>If you use backup software that can be configured to send an email report
after each backup run, you can monitor it with SITE_NAME. Create a new check in
SITE_NAME and configure your backup software to send email reports to its email
address. Then set up keywords in the <strong>Filtering Rules</strong> dialog to distinguish
between successful and failed backup runs. SITE_NAME will keep quiet as long
as it receives regular success reports, but will notify you when it
does not receive a success report for too long or receives a failure report.</p>
<h2>Email Delivery Delays</h2>
<p>Emails are more susceptible to random delivery delays than HTTP requests.
Adjust the grace time parameter for your checks to account for the
possible email delivery delays, and avoid false alerts.</p>
<p>Tracking job durations (using the "start" and "success" signals) will be less
accurate when pinging via email and may not be feasible at all for jobs with
very short durations.</p>