Not a customer? Click the 'Start a free trial' link to begin a 30-day SaaS trial of our product and to join our community.
Existing Cisco AppDynamics customers should click the 'Sign In' button to authenticate to access the community
10-11-2017 03:17 AM - last edited on 04-26-2022 02:04 PM by Ryan.Paredez
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.
POST /controller/rest/applications/application_id/events
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.
10-11-2017 11:20 PM
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
10-12-2017 07:13 PM
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?
10-12-2017 11:35 PM
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
10-15-2017 08:10 PM
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:
HTTP/1.1 500 Internal Server Error;
and If remove '\' screenshot:
10-16-2017 05:34 AM
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
10-17-2017 12:13 AM
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:
Please forgive me for this stupid question,haha, Whether it can provide help or whether there is a demo? Thanks again.
10-22-2017 07:35 PM
10-24-2017 05:59 AM
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
User | Count |
---|---|
1 | |
1 | |
1 | |
1 |
Thank you! Your submission has been received!
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form