06 Apr 2023 05:05 PM
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?
Solved! Go to Solution.
06 Apr 2023 05:56 PM
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
07 Apr 2023 06:31 PM
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).
07 Apr 2023 07:00 PM
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.