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

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

lil317576098
Creator

Hi all,

Create a Custom Event

 

You can create custom events to be reported in the AppDynamics event viewer and in the event's 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 the 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****

 

[Redacted]

)

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

How can I solve it?

 

^ Post edited by @Ryan.Paredez to remove Controller URL. Please do not share your Controller URL for Privacy and Security reasons.

8 REPLIES 8

Yogesh.Chouk
AppDynamics Team

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



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

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? 

 

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

 



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

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

 

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



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

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.

Hi yogesh.chouk ,

 

Can you help me solve the new problem?

I do not know how to start, thanks

Hi,

 

Can you go through the below link and let us know if it helps.

https://stackoverflow.com/questions/15089000/how-can-pass-multiple-parameters-in-nsurl-string-in-ios

 

Thanks,

Yogesh



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