# Restart Web server in case a problem is occured

**URL:** <https://community.dynatrace.com/t/restart-web-server-in-case-a-problem-is-occured/21464>\
**Category:** Automations\
**Tags:** problems-classic, automation\
**Created:** [February 9, 2021, 9:21am UTC](https://community.dynatrace.com/t/restart-web-server-in-case-a-problem-is-occured/21464 "2021-02-09T09:21:03Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![kanari\_naiki](https://avatars.discourse-cdn.com/v4/letter/k/a698b9/32.png) [@kanari\_naiki](https://community.dynatrace.com/u/kanari_naiki)\
**Post date:** [February 9, 2021, 9:21am UTC](https://community.dynatrace.com/t/restart-web-server-in-case-a-problem-is-occured/21464/1 "2021-02-09T09:21:03Z")

</div>

We want to trigger a command automatically to restart the application service (like apache) when a host doesn’t make any http response. To do so, we need to execute a command on the host.

---

<div class="post-metadata">

**Author:** ![Radoslaw\_Szulgo](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/radoslaw_szulgo/32/1977_2.png) [@Radoslaw\_Szulgo](https://community.dynatrace.com/u/Radoslaw_Szulgo)\
**Post date:** [February 9, 2021, 9:40am UTC](https://community.dynatrace.com/t/restart-web-server-in-case-a-problem-is-occured/21464/2 "2021-02-09T09:40:12Z")

</div>

You can already achieve this by configuring a auto-remediation using alerting profiles.

You can ready here : [Problem alerting profiles — Dynatrace Docs](https://www.dynatrace.com/support/help/how-to-use-dynatrace/problem-detection-and-analysis/notifications-and-alerting/alerting-profiles/?_ga=2.262503557.829344646.1612702676-1422079616.1607679033&_gac=1.51943515.1612810532.Cj0KCQiA34OBBhCcARIsAG32uvOrsadiZj-2LBaze5Aa7enuwRNQA20XmK5XroVkH9WsKb6p4BtdXHoaAimlEALw_wcB)

Here’s a similar question: [https://community.dynatrace.com/spaces/482/dynatrace-open-qa/questions/240675/problem-auto-remediation-with-dynatrace.html](https://community.dynatrace.com/spaces/482/dynatrace-open-qa/questions/240675/problem-auto-remediation-with-dynatrace.html)

Here’s a blog post for SNOW integration: [Leveraging ServiceNow and Dynatrace](https://www.dynatrace.com/news/blog/leveraging-servicenow-dynatrace-to-automate-incident-management-and-problem-remediation-2/)

I’m sure you can find a lot of different materials about this.

In short:

1. Set up an alerting profile and define either a custom event or use existing one.

2. Use Ansible Tower, SNOW, Jenkins, Keptn or whatever else that works for you to trigger a desired job - e.g. restart a host XYZ

3. Bind the notification of the event to remediation action.

---

<div class="post-metadata">

**Author:** ![kanari\_naiki](https://avatars.discourse-cdn.com/v4/letter/k/a698b9/32.png) [@kanari\_naiki](https://community.dynatrace.com/u/kanari_naiki)\
**Post date:** [February 9, 2021, 9:52am UTC](https://community.dynatrace.com/t/restart-web-server-in-case-a-problem-is-occured/21464/3 "2021-02-09T09:52:47Z")

</div>

It’s helpful for me, thank you!

\>2. Use Ansible Tower, SNOW, Jenkins, Keptn or whatever else that works for you to trigger a desired job - e.g. restart a host XYZ

Can I use Ansible instead of Ansible Tower?

---

<div class="post-metadata">

**Author:** ![Radoslaw\_Szulgo](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/radoslaw_szulgo/32/1977_2.png) [@Radoslaw\_Szulgo](https://community.dynatrace.com/u/Radoslaw_Szulgo)\
**Post date:** [February 9, 2021, 9:55am UTC](https://community.dynatrace.com/t/restart-web-server-in-case-a-problem-is-occured/21464/4 "2021-02-09T09:55:53Z")

</div>

No, you cannot. Ansible is just a “scripting” language and doesn’t have any REST API that Dynatrace can communicate with. But you can use Jenkins or other CI/CD you have that triggers the ansible.

---

<div class="post-metadata">

**Author:** ![kanari\_naiki](https://avatars.discourse-cdn.com/v4/letter/k/a698b9/32.png) [@kanari\_naiki](https://community.dynatrace.com/u/kanari_naiki)\
**Post date:** [February 9, 2021, 10:01am UTC](https://community.dynatrace.com/t/restart-web-server-in-case-a-problem-is-occured/21464/5 "2021-02-09T10:01:55Z")

</div>

I understand. Thank you for confirmation!

I wanted to achieve self-healing without those tools.

Can I request this?

---

<div class="post-metadata">

**Author:** ![kanari\_naiki](https://avatars.discourse-cdn.com/v4/letter/k/a698b9/32.png) [@kanari\_naiki](https://community.dynatrace.com/u/kanari_naiki)\
**Post date:** [February 9, 2021, 10:12am UTC](https://community.dynatrace.com/t/restart-web-server-in-case-a-problem-is-occured/21464/6 "2021-02-09T10:12:44Z")

</div>

Hello, I found same question! :

> **[Ansible without Tower](https://community.dynatrace.com/t5/Open-Q-A/Ansible-without-Tower/m-p/114226)**
>
> Hello, We are currently interested in integrating ansible with Dynatrace by way of "Self-Healing" described here (https://www.dynatrace.com/news/blog/self-healing-a...) We currently only have ansible engine, and not the tower component that is...

Can I do this?

---

<div class="post-metadata">

**Author:** ![Radoslaw\_Szulgo](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/radoslaw_szulgo/32/1977_2.png) [@Radoslaw\_Szulgo](https://community.dynatrace.com/u/Radoslaw_Szulgo)\
**Post date:** [February 9, 2021, 10:14am UTC](https://community.dynatrace.com/t/restart-web-server-in-case-a-problem-is-occured/21464/7 "2021-02-09T10:14:29Z")

</div>

You can request anything… but IMHO it is not feasible.

---

<div class="post-metadata">

**Author:** ![Radoslaw\_Szulgo](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/radoslaw_szulgo/32/1977_2.png) [@Radoslaw\_Szulgo](https://community.dynatrace.com/u/Radoslaw_Szulgo)\
**Post date:** [February 9, 2021, 10:16am UTC](https://community.dynatrace.com/t/restart-web-server-in-case-a-problem-is-occured/21464/8 "2021-02-09T10:16:43Z")

</div>

That’s exactly what I write - you need sth to receive REST calls from Dynatrace. No matter if this is :

- Ansible Tower

- AWX  
- Ansible Python/Webhook … whatever else..

- You can even have your own webserver that will trigger Ansible.

---

<div class="post-metadata">

**Author:** ![kanari\_naiki](https://avatars.discourse-cdn.com/v4/letter/k/a698b9/32.png) [@kanari\_naiki](https://community.dynatrace.com/u/kanari_naiki)\
**Post date:** [February 9, 2021, 10:20am UTC](https://community.dynatrace.com/t/restart-web-server-in-case-a-problem-is-occured/21464/9 "2021-02-09T10:20:02Z")

</div>

I’m sorry I didn’t understand well…

Is it possible to share with me about Ansible Webhook..?

---

<div class="post-metadata">

**Author:** ![Radoslaw\_Szulgo](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/radoslaw_szulgo/32/1977_2.png) [@Radoslaw\_Szulgo](https://community.dynatrace.com/u/Radoslaw_Szulgo)\
**Post date:** [February 9, 2021, 10:23am UTC](https://community.dynatrace.com/t/restart-web-server-in-case-a-problem-is-occured/21464/10 "2021-02-09T10:23:21Z")

</div>

[https://github.com/scalr-tutorials/ansible-webhook](https://github.com/scalr-tutorials/ansible-webhook)

---

<div class="post-metadata">

**Author:** ![kanari\_naiki](https://avatars.discourse-cdn.com/v4/letter/k/a698b9/32.png) [@kanari\_naiki](https://community.dynatrace.com/u/kanari_naiki)\
**Post date:** [February 9, 2021, 10:24am UTC](https://community.dynatrace.com/t/restart-web-server-in-case-a-problem-is-occured/21464/11 "2021-02-09T10:24:38Z")

</div>

Thank you for your kindly support. I will check.
