cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Custom event with PingPlotter and API

bill_scheuernst
DynaMight
DynaMight

I am currently working on pushing alerts coming out of PingPlotter to Dynatrace SaaS. What I would like to do is create a "PERFORMANCE_EVENT" in Dynatrace when an alert is generated in PingPlotter. This is what I have so far...

{

"eventType": "PERFORMANCE_EVENT",

"description": "string",

"title": "string",

"source": "string",

"timeoutMinutes": "60",

"attachRules": {


"tagRule": [

{

"meTypes": "APPLICATION",

"tags": [

{

"context": "ENVIRONMENT",

"key": "customTag"

}

]

}

]

},

"host": "${Host}",

"alertName": "${AlertName}",

"destinationHost": "${DestinationHost}"

}


When I test the API, I'm getting...

{ "error": { "code": 400, "message": "Invalid attachRules object provided. No MEIdentifier do match: Matching rule: PushEventAttachRules{entityIds=null, tagRules=[TagMatchRule{meTypes=[APPLICATION], tags=[[ENVIRONMENT]customTag]}]}" }
}


I have gone through the documentation multiple times!


Help!!


Dynatrace Certified Professional
4 REPLIES 4

bill_scheuernst
DynaMight
DynaMight

pingplotterDT_eventPush.txt


New file...same problem. I've walked through the API model.

Bad request error - { "error": { "code": 400, "message": "Invalid attachRules object provided. No MEIdentifier do match: Matching rule: PushEventAttachRules{entityIds=null, tagRules=[TagMatchRule{meTypes=[APPLICATION], tags=[[CONTEXTLESS]customTag]}]}" }
}


Dynatrace Certified Professional

wolfgang_beer
Dynatrace Leader
Dynatrace Leader

I think you have to specify the tags key in a 'key' field as shown below:


{

"eventType": "ERROR_EVENT",

"title" : "Power outage",

"description" : "UPS detected a power outage",

"timeoutMinutes" : 60,

"attachRules": {

"entityIds":[],

"tagRule":[{

"meTypes" : [ "HOST" ],

"tags" : [ { "context" : "CONTEXTLESS", "key" : "clinic" } ]

}]

},

"source":"UPS-123 (Datacenter South)",

"customProperties":

{

"PowerLevel": "20.000Ah",

"Estimation": "3 hours",

"UPS-Model": "APC Smart-UPS C 1000VA, USB"

}

}


I will review our help doc to provide better examples on that.


Was wondering, is this issue resolved yet?


Ahmed_mohamed-s
Newcomer

Hi All,

I have the same issue, and i have tried the proposed example and received the same issue


Request

https://myenvironment/e/1c73bd17-f3f1-4c29-af69-f2447189a9c3/api/v1/events \

-H 'Authorization: Api-token mytoken' \

-H 'Content-Type: application/json' \

-d '{

"eventType": "ERROR_EVENT",

"title" : "Power outage",

"description" : "UPS detected a power outage",

"timeoutMinutes" : 60,

"attachRules": {

"entityIds":[],

"tagRule":[{

"meTypes" : [ "HOST" ],

"tags" : [ { "context" : "CONTEXTLESS", "key" : "clinic" } ]}

]},

"source":"UPS-123 (Datacenter South)",

"customProperties":{

"PowerLevel": "20.000Ah",

"Estimation": "3 hours",

"UPS-Model": "APC Smart-UPS C 1000VA, USB"}

}


Error received:

"code":400,"message":"Invalid attachRules object provided. No MEIdentifier do match: Matching rule: PushEventAttachRules{entityIds=[], tagRules=[TagMatchRule{meTypes=[HOST], tags=[[CONTEXTLESS]clinic]}]}"}}


Thanks,

Ahmed

Featured Posts