# Ansible problem notification

**URL:** <https://community.dynatrace.com/t/ansible-problem-notification/39197>\
**Category:** Open Q&A\
**Tags:** integrations, problem-notification, ansible\
**Created:** [April 6, 2023, 4:05pm UTC](https://community.dynatrace.com/t/ansible-problem-notification/39197 "2023-04-06T16:05:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![michael\_stevens](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/michael_stevens/32/20894_2.png) [@michael\_stevens](https://community.dynatrace.com/u/michael_stevens)\
**Post date:** [April 6, 2023, 4:05pm UTC](https://community.dynatrace.com/t/ansible-problem-notification/39197/1 "2023-04-06T16:05:29Z")

</div>

I have Dynatrace integrated with Ansible Automation Platform for problem notification. The remediation is working excellent - Dynatrace detects the problem and triggers the template in Ansible. My issue is when Dynatrace detects the problem as resolved it triggers the Ansible template a second time even though the issue has been resolved. Any tips?

---

<div class="post-metadata">

**Author:** ![michiel\_otten](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/michiel_otten/32/21987_2.png) [@michiel\_otten](https://community.dynatrace.com/u/michiel_otten)\
**Post date:** [April 6, 2023, 4:56pm UTC](https://community.dynatrace.com/t/ansible-problem-notification/39197/2 "2023-04-06T16:56:07Z")

</div>

Hi,

Two ways to fix it. If you set up a custom alert you can prevent dynatrace to send an alert when a problem closes.

If the default way (ansible) sends out a second one when a problem closes and you cant edit this in the problem alerting setting, you can filter it out in your ansible template.

_In_ the payload there is a problem status “closed”, just use this value and stop the ru book if the value is not “new”

KR.

Michiel

---

<div class="post-metadata">

**Author:** ![michael\_stevens](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/michael_stevens/32/20894_2.png) [@michael\_stevens](https://community.dynatrace.com/u/michael_stevens)\
**Post date:** [April 7, 2023, 5:31pm UTC](https://community.dynatrace.com/t/ansible-problem-notification/39197/3 "2023-04-07T17:31:00Z")

</div>

I’m on the right track. It seems the problem is Ansible is not receiving the payload. I’ve tried the built-in Ansible integration, I’ve also tried the webhook. I can initiate the template w/o issue, however, the payload with the variables is not being received.

Here is my payload:

{  
“State”:“{State}”,  
“ProblemID”:“{ProblemID}”,  
“ProblemTitle”:“{ProblemTitle}”,  
“ImpactedEntity”:“{ImpactedEntity}”  
}

I’ve used the same payload in testing a webhook to my ITSM tool and it is received. Any additional tips on where to look next? We’re using the latest platform of Ansible Automation (ver 2.3).

---

<div class="post-metadata">

**Author:** ![michiel\_otten](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/michiel_otten/32/21987_2.png) [@michiel\_otten](https://community.dynatrace.com/u/michiel_otten)\
**Post date:** [April 7, 2023, 6:00pm UTC](https://community.dynatrace.com/t/ansible-problem-notification/39197/4 "2023-04-07T18:00:31Z")

</div>

In Ansible you give in extra variables which you can use in a template. Investigate setting something up as:

{“extra\_vars”: {“dt\_pid”:“{PID}”}}

Ansible will see the extra vars in the payload.
