Controller (SaaS, On Premise)

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create mobile apps Custom Event alert and respond send eamil.

New Contributor

How to create mobile apps Custom Event alert and respond send eamil.

Hi all,

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

How can i solve it?

 

How to create mobile apps Custom Event alert and respond send eamil.
6 REPLIES
Employee

Re: How to create mobile apps Custom Event alert and respond send eamil.

Hi

 

Could you please try below and let us know if it helps. 

 

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

 

Thanks,

Yogesh

New Contributor

Re: How to create mobile apps Custom Event alert and respond send eamil.

Hi,

This is the rest api I've been using.

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 =value2

The summary has been defined, but always prompts HTTP / 1.1 400 Event summary is not specified. what should I do? 

 

Employee

Re: How to create mobile apps Custom Event alert and respond send eamil.

Hi,

 

Can yo please try as suggested earlier? We have suggested to use '\' before &summary=test1.

Kindly try above and let us know if that helps. Please share screenshot of request and response both in case if you still face an issue.

 

Thanks,

Yogesh

 

New Contributor

Re: How to create mobile apps Custom Event alert and respond send eamil.

Hi,

 

Thanks for your reply and help,I try the same as you said,but not yet successful.

curl -i -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

 Include an error screenshot:

Snip20171016_4.png

HTTP/1.1 500 Internal Server Error;

and If  remove '\' screenshot:

Snip20171016_5.png

 

Employee

Re: How to create mobile apps Custom Event alert and respond send eamil.

Hi,

 

We checked for the error logs into your saas account 'hsbccmbtest' and it was as below.

Caused by: javax.ejb.AccessLocalException: Client not authorized for this invocation
	at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:1960)
	at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:210)

 It looks like you do not have enough permissions to create a custom events. To create the event, user need an Admin or Account owner role. Please assign the admin or account owner role to yourself and execute the rest api suggested by us ealier i.e including '\'. Let us know if you face any issues after this.

 

Thanks,

Yogesh

New Contributor

Re: How to create mobile apps Custom Event alert and respond send eamil.

Hi,

Thank you very much . I will find an account to try again,

Still have a problem,Use curl to send the request in the terminal,how should I send a request in iOS code?

Because apm not only need username and password also need an Account,and we do not use libcurl.

The following is my post request in the code:

Always can not send success,how do I add an account password?

NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://hsbccmbtest.saas.appdynamics.com/controller/rest/applications/HSBCNET_SDE4/events?severity=WARN&eventtype=CUSTOM\&summary=test1&customeventtype=mycustomevent&propertynames=hostName&propertyvalues=failed"]];

NSMutableURLRequest *request =[NSMutableURLRequest requestWithURL:url];
request.HTTPMethod = @"POST";
NSString *args=[NSString stringWithFormat:@"janice_***@hsbccmbtest:janice****"];
request.HTTPBody = [args dataUsingEncoding:NSUTF8StringEncoding];
NSURLSession *session = [NSURLSession sharedSession];

NSURLSessionDataTask *sessionDataTask = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
NSLog(@"%@",data);
}];
[sessionDataTask resume];

 This is the result of sending,failure:

Snip20171017_7.png

Please forgive me for this stupid question,haha, Whether it can provide help or whether there is a demo? Thanks again.