23 Sep 2024 10:22 AM - last edited on 24 Sep 2024 07:39 AM by MaciejNeumann
Hello,
I'm looking for a solution to post new events from infrastructural components (Element Managers) that can use the Events API to post new (error) events. I'm trying to post new events but they seem to only accept them if the hostname already exists in the Dynatrace environment. How should I post these events so they will be visible in
DT so I can use the notifier to send them to a service management solution like ServiceNow.
23 Sep 2024 07:56 PM
A normal lifecycle is problem problem-opening event resulting in a Dynatrace problem. Problems can be then sent using alerting profiles and integrations to 3rd party tools such as Service Now.
Dynatrace works on the SmartScape entity model. This model can be enriched using custom topology and then you can send such problem opening events to those entities. So basically you need to create those custom entities first to be able to send events to them and raise problems.
There are also other possible solutions such as sending just log events and having problems created from logs only.
What element manager is the source of your events? Does it know at least a list of the devices it is managing?
26 Sep 2024 03:14 PM
Hello @xstreur
As simple as that:
Then Execute > upon successful execution > you should receive one of the below Response codes.
To create custom device through UI
Under Infrastructure Observability > Technologies and processes > Custom Devices
After that proceed with Events ingestion through Environment Api v2, just an example, you can customize as per actual requirements:
Finally
You have options to either:
So, all events will be correlated to the impacted entities, you will be notified in case of any impact or issues.
Or
You can configure CMDB integration between Dynatrace and Service Now it will figure out a comprehensive monitoring and integration Landscape.
Kind Regards,
Peter.
30 Sep 2024 02:05 PM
Please evaluate te script here below. The cutome device is added but no events are accepted (reportCount 0):
#!/bin/bash
# set -x
CiTkn="Token1"
CrtTkn="Token2"
# ##############################################################
# Add Custom Device
# ##############################################################
curl -k -X 'POST' \
"https://10.224.73.9/e/9b3c1c96-fbed-4434-b713-c063b98ba1d7/api/v2/entities/custom?uiBased=true" \
-H 'accept: application/json; charset=utf-8' \
-H "Authorization: Api-Token ${CiTkn}" \
-H 'Content-Type: application/json; charset=utf-8' \
-d '{
"configUrl": "",
"customDeviceId": "v5060mgt1234",
"displayName": "Router1234",
"dnsNames": [
"v5060mgt1234.grit-ot.nl"
],
"group": "myCustomDeviceGroup",
"ipAddresses": [
"10.224.73.123"
],
"listenPorts": [
80
],
"properties": {},
"type": "Router"
}'
# ##############################################################
# Report Event
# ##############################################################
curl -k -X 'POST' \
"https://10.224.73.9/e/9b3c1c96-fbed-4434-b713-c063b98ba1d7/api/v2/events/ingest" \
-H 'accept: application/json; charset=utf-8' \
-H "Authorization: Api-Token ${CrtTkn} "\
-H 'Content-Type: application/json; charset=utf-8' \
-d '{
"entitySelector": "type(SERVICE),entityName.startsWith(v5060mgt1234)",
"eventType": "ERROR_EVENT",
"properties": {
"dt.event.allow_davis_merge": "false",
"componentName": "Power Supply",
"eventDescription": "Device temperature above 105 degrees"
},
"title": "CustomEvent",
"timeout": 360
}'
02 Oct 2024 09:13 AM
Event when creating the CI (Host) the ingest of a related event does not work. I made a shell script that first adds the CI to the Dynatrace environment (Works and is seen in DynaTrace) but an event for this host gets reportCount 0. When I use the same event to for an existing host (that have an OneAgent installed). it does work. See the reply with my script for the used API's