# Setting email notification when Synthetic HTTP Monitor fails

**URL:** <https://community.dynatrace.com/t/setting-email-notification-when-synthetic-http-monitor-fails/48045>\
**Category:** Alerting\
**Tags:** problem-notification, problems-classic\
**Created:** [September 30, 2024, 11:54am UTC](https://community.dynatrace.com/t/setting-email-notification-when-synthetic-http-monitor-fails/48045 "2024-09-30T11:54:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pseg1984](https://avatars.discourse-cdn.com/v4/letter/p/c77e96/32.png) [@pseg1984](https://community.dynatrace.com/u/pseg1984)\
**Post date:** [September 30, 2024, 11:54am UTC](https://community.dynatrace.com/t/setting-email-notification-when-synthetic-http-monitor-fails/48045/1 "2024-09-30T11:54:00Z")

</div>

Hi,

i have more than 10 synthetic tests with HTTP Monitor, all are api calls.

in the synthetic test settings at Outage handling i activated

-Generate a problem and send alert when the monitor is unavailable at all configuration locations. Ok but i don’t really need this one for now.

-Generate a problem and send alert when the monitor is unavailable for one or more consecutive runs at any locations: i don’t need this one too for now.

Then in Settings/Alerting/Problem alerting profiles i added notification with basic rules.

Then in&nbsp;Settings/Integration/Problem notifications i added my email.

i clicked on test send alert.

i sends the alert by email.

In my HTTP Monitor test i have this:

post-execution:

var StatusCode =reponsegetStatusCode();

if(statusCode === 400 ||&nbsp;statusCode === 403 ||&nbsp;statusCode === 500 ||&nbsp;statusCode === 503){

api.fail("Test failed: " + statusCode)}

But when my HTTP Monitor fails i don’t receive email notifications.

Thanks

---

<div class="post-metadata">

**Author:** ![Peter\_Youssef](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/peter_youssef/32/14668_2.png) [@Peter\_Youssef](https://community.dynatrace.com/u/Peter_Youssef)\
**Post date:** [September 30, 2024, 12:57pm UTC](https://community.dynatrace.com/t/setting-email-notification-when-synthetic-http-monitor-fails/48045/2 "2024-09-30T12:57:37Z")

</div>

Hi&nbsp;[@pseg1984](https://community.dynatrace.com/user/80625)

First of all, thanks for sharing your concern:

1. Create a management zone to include all created HTTP monitors.
2. Create alerting profile based on the created management zone.
3. In the alerting profile, you will keep only the availability, you don’t need all other options as long as you’re executing HTTP tests against URLs or APIs.
4. Ensure enabling the attached option for outage handling, otherwise you won’t receive alerts.
5. Under Integrations\>&nbsp; Problem notifications \> Email \> specify your email, and alerting profile \> send test notification to check the successful configurations.

 ![6.png](https://global.discourse-cdn.com/dynatrace/original/3X/3/a/3a9ca8d052b43f9737b6eaab6cf14c7a9ff25a2f.png)

**For Post execution, you can add it under Post execution scripts**

 ![7.png](https://global.discourse-cdn.com/dynatrace/original/3X/9/c/9cd5ad6b54cb4478c583472f0e4bce64e3d5abb6.png)

As long as your post execution script returns the actual response code, no need to set rules for Response validation.

 ![8.png](https://global.discourse-cdn.com/dynatrace/original/3X/8/2/82c789f070195666e39869843f4db11acd0e4863.png)

KR,

---

<div class="post-metadata">

**Author:** ![pseg1984](https://avatars.discourse-cdn.com/v4/letter/p/c77e96/32.png) [@pseg1984](https://community.dynatrace.com/u/pseg1984)\
**Post date:** [September 30, 2024, 1:11pm UTC](https://community.dynatrace.com/t/setting-email-notification-when-synthetic-http-monitor-fails/48045/3 "2024-09-30T13:11:19Z")

</div>

yes i did all this as you mention, i will check now if i receive alerts or not.
