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

How to send a custom event in the code to the APM, receive a custom event automatically send email ?

lil317576098
Creator

How to send a custom event in the code to the APM, receive a custom event automatically send email ?

2 REPLIES 2

Atyuha.Pal
AppDynamics Team

Hi,

1.Please refer to the below doc  for creating a custom event

https://docs.appdynamics.com/display/PRO43/Alert+and+Respond+API#AlertandRespondAPI-CreateaCustomEve...

 

2. Please refer to the below doc to create actions in the policy to execute

https://docs.appdynamics.com/display/PRO41/Actions

 

Thanks,

Atyuha



Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.

Hi,

I customize the event according to the document,

Create a Custom Event

You can create custom events to be reported in the AppDynamics event viewer and in the events panels on the AppDynamics dashboards. See Monitor Events  to learn how to filter on your custom events so that you can find them. Then you can create alerts triggered by these events as you do for AppDynamics standard events.

You should receive the event ID after successful invocation of the request.

URI 

POST /controller/rest/applications/application_id/events

Input parameters

I created a post request based on the document ( 

curl -X POST --user janice_****@hsbccmbtest:janice****https://hsbccmbtest.saas.appdynamics.com/controller/rest/applications/HSBCNET_SDE4/events?severity=INFO&summary=test1&eventtype=CUSTOM&customeventtype=mycustomevent&propertynames=key1&propertyvalues=value1&propertyvalues=value

)

 

Run on the terminal  , Always prompts HTTP / 1.1 400 Event summary is not specified

(

curl -i -X POST --user janice_wang@hsbccmbtest:janiceWang1 https://hsbccmbtest.saas.appdynamics.com/controller/rest/applications/HSBCNET_SDE4/events?severity=I...

[1] 11428

[2] 11429

[3] 11430

[4] 11431

[5] 11432

[6] 11433

[7] 11434

[2]   Done                    summary=test1

[3]   Done                    eventtype=CUSTOM

[4]   Done                    customeventtype=mycustomevent

[5]   Done                    propertynames=key1

[6]-  Done                    propertynames=key2

[7]+  Done                    propertyvalues=value1

MacBook-Air:~ h$ HTTP/1.1 400 Event summary is not specified

Server: AppDynamics

Set-Cookie: JSESSIONID=3a55b83eece7144710e3795baae9; Path=/controller; HttpOnly;Secure

Content-Language:

Content-Type: text/html

Date: Fri, 13 Oct 2017 02:52:04 GMT

X-Varnish: 1574221971

Age: 0

Via: 1.1 varnish

Connection: keep-alive

Set-Cookie: visid_incap_962359=UJiixdR9QJ+R8G2a8UjDAlQq4FkAAAAAQUIPAAAAAACinpDeYOaZjjor3TsDCmOJ; expires=Fri, 12 Oct 2018 07:59:18 GMT; path=/; Domain=.saas.appdynamics.com

Set-Cookie: nlbi_962359=WCcKQpDvG2RgvM7NCyMyLAAAAACPojL7pEZnrMVzXO+HxSBQ; path=/; Domain=.saas.appdynamics.com

Set-Cookie: incap_ses_628_962359=cL02JzNTO1XGFTdhFxu3CFQq4FkAAAAA6IR3yu9+35OVzYCSjA/7SA==; path=/; Domain=.saas.appdynamics.com

X-Iinfo: 8-93532647-93532677 NNNN CT(0 0 0) RT(1507863124187 237) q(0 0 0 0) r(2 2) U6

X-CDN: Incapsula

Transfer-Encoding: chunked

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>AppDynamics - Error report</title><style type="text/css"><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 400 - Event summary is not specified</h1><hr/><p><b>type</b> Status report</p><p><b>message</b>Event summary is not specified</p><p><b>description</b>The request sent by the client was syntactically incorrect.</p><hr/><h3>AppDynamics</h3><script type="text/javascript">

//<![CDATA[

(function() {

var _analytics_scr = document.createElement('script');

_analytics_scr.type = 'text/javascript'; _analytics_scr.async = true; _analytics_scr.src='/_Incapsula_Resource?SWJIYLWA=719d34d31c8e3a6e6fffd425f7e032f3&ns=1&cb=53430638';

var _analytics_elem = document.getElementsByTagName('script')[0]; _analytics_elem.parentNode.insertBefore(_analytics_scr, _analytics_elem);

})();

// ]]>

)

How can i solve it?