23 Nov 2022 08:51 AM - last edited on 20 Aug 2024 03:11 PM by Michal_Gebacki
Hi Team,
Greetings of the day.
I am new to dynatrace.My question is how to store custom problem notifications data in to
sql server database using Dynatrace API.I am unfamiliar with a best way to achieve this.
Please share any recommendations for how to achieve this.
Thanks in advance!
Solved! Go to Solution.
23 Nov 2022 12:57 PM
Hi @Koteswar
You should use the Probelm APIv2. You need an API token with probelm.read scope.
Collect the closed custom severity problem ids for the last day (-1d):
curl -X GET https://your_environment/api/v2/problems?from=-1d&problemSelector=severityLevel%28%22CUSTOM_ALERT%22%29%2Cstatus%28%22closed%22%29 -H "accept: application/json; charset=utf-8" -H "Authorization: Api-Token YOUR TOKEN
Use the collected problem ids (bold in the middle is an individual prolem id), then you will receive the details of this individual problem.
curl -X GET https:// your_environment/api/v2/problems/-7695485534087673753_1669185960000V2 -H "accept: application/json; charset=utf-8" -H "Authorization: Api-Token YOUR TOKEN"
I have already attached a sample response from an individual custom problem.
I hope it helps to start build your process.
Best regards,
Mizső
24 Nov 2022 02:11 AM
@MizsőThank you for quick response. Yes the above information is helpful but my specific requirement is automatically to save problem notification(log) data to sql server for further investigation. Please advise on this.
Thanks in advance!
24 Nov 2022 06:06 AM
Hi @Koteswar,
I think there is not other way to pull problem data from DT. You should build your auto process for this procedure.
Best regards,
Mizső
24 Nov 2022 09:11 AM - edited 24 Nov 2022 09:14 AM
Hi @Mizső thank you for sharing the information.
Please advise on my second question, I have created alerting profile and linked with email alert notification. Test email is triggering and receiving email alert successfully but when the problem has notified in Dynatrace, email alert is not triggering.
Many Thanks.
24 Nov 2022 09:48 AM
Hi @Koteswar
For automate this procedure you can build ActiveGate extension
HTH
Yos