# Event/alert trigger a script

**URL:** <https://community.dynatrace.com/t/event-alert-trigger-a-script/37755>\
**Category:** Open Q&A\
**Tags:** integrations, problem-notification, problems-classic\
**Created:** [December 20, 2022, 8:01am UTC](https://community.dynatrace.com/t/event-alert-trigger-a-script/37755 "2022-12-20T08:01:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![clc](https://avatars.discourse-cdn.com/v4/letter/c/71c47a/32.png) [@clc](https://community.dynatrace.com/u/clc)\
**Post date:** [December 20, 2022, 8:01am UTC](https://community.dynatrace.com/t/event-alert-trigger-a-script/37755/1 "2022-12-20T08:01:04Z")

</div>

Hi,

Been looking for a way to trigger a script if a event/alert happens, what is the easiest way of doing this?

Usecase - Custom log entry metric need to trigger a script that restart process.

-Claus

---

<div class="post-metadata">

**Author:** ![mizso74](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mizso74/32/41729_2.png) [@mizso74](https://community.dynatrace.com/u/mizso74)\
**Post date:** [December 20, 2022, 8:48am UTC](https://community.dynatrace.com/t/event-alert-trigger-a-script/37755/2 "2022-12-20T08:48:27Z")

</div>

Hi&nbsp;[@clc](https://community.dynatrace.com/user/12958),

You should set up a metric event.

 ![Mizs_1-1671525898254.png](https://global.discourse-cdn.com/dynatrace/original/3X/5/3/535f6c58bbea801e3d74ef1426ef8e7c6e86e7e3.png)

Then create a problem notification eg. to Ansible or any Custom Integraion (if you do not have Ansible)

 ![Mizs_0-1671525804083.png](https://global.discourse-cdn.com/dynatrace/original/2X/1/1e83fc26e7c39707e0384d73a593e8889cceced1.png)

I hope it helps.

Best regards,

Mizső

---

<div class="post-metadata">

**Author:** ![Bert\_VanderHeyd](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/bert_vanderheyd/32/162_2.png) [@Bert\_VanderHeyd](https://community.dynatrace.com/u/Bert_VanderHeyd)\
**Post date:** [December 29, 2022, 3:13pm UTC](https://community.dynatrace.com/t/event-alert-trigger-a-script/37755/3 "2022-12-29T15:13:11Z")

</div>

In addition to the answer of&nbsp;[@Mizső](https://community.dynatrace.com/user/47783)&nbsp;I would also suggest to also use an alerting profile which you configure to only include that specific metric event.
