Created 12-11-2018 01:08 AM
Alert Target JSON needs to include Email To, SMTP server, port, email from, authentication, username, and password info. I need to know how to format this information with existing object: "AlertTarget": { "name": "sdf", "description": "sdf.", "notification_type": "EMAIL", "global": "true", "alert_states": ["CRITICAL"], "properties": { "ambari.dispatch-property.script": "my.custom.alert.dispatcher.script" } } }
Created 12-11-2018 03:42 PM
I agree with Akhil, we'd need some more information about what you are trying to do. However, his links are a great place to start. Also, it seems like you're trying to use the REST APIs directly. In which case, this link might also be of some help since it gives examples for using the alert groups and targets endpoints:
https://github.com/apache/ambari/blob/trunk/ambari-server/docs/api/v1/alert-dispatching.md
Created 12-11-2018 04:44 AM
Hi @Ashen Parikh,
from your question its not clear what you are trying to do.
if you are trying to get notified for alerts in ambari. you can refer to following doc: https://docs.hortonworks.com/HDPDocuments/Ambari-2.6.2.2/bk_ambari-operations/content/creating_or_ed...
if you want to customize the alert template : https://cwiki.apache.org/confluence/display/AMBARI/Customizing+the+Alert+Template
if these are not helping you revert with your exact query and what you are trying to achieve.
Please accept this answer if you find it helpful.
Created 12-11-2018 03:42 PM
I agree with Akhil, we'd need some more information about what you are trying to do. However, his links are a great place to start. Also, it seems like you're trying to use the REST APIs directly. In which case, this link might also be of some help since it gives examples for using the alert groups and targets endpoints:
https://github.com/apache/ambari/blob/trunk/ambari-server/docs/api/v1/alert-dispatching.md
Created on 12-13-2018 07:20 PM - edited 08-17-2019 03:50 PM
Thank you @Akhil S Naik for the documentation. I was looking to complete a post of an alert target to the /api/v1/alert_targets/ API via Python. I was missing the syntax for some fields that I found thanks to @Jonathan Hurley The documentation didn't appear in my search results initially. Now, I have been able to successfully post the alert target with the exception when I try to specify a particular Alert Group rather than all. The documentation provided includes the syntax for all groups not one group.
The image attached contains the Alert Group Info. Could you let me know where the syntax needs to be modified?
Created 12-13-2018 08:12 PM
In order to associate an `AlertTarget` with specific groups, you would use the `groups` property along with an array of IDs for the groups you care about:
{ "AlertTarget": { "name": "Administrators", "description": "The Admins", "notification_type": "EMAIL", "groups": [1, 17, 23], ... } }
Created 09-17-2019 07:00 AM
Hi
do we have something similar for cloudera (custom alerts)?
Regads
Amjad
Created 12-13-2018 11:10 PM
Thanks Jonathan, I appreciate it.