Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

REST call for alerts only

avatar
Visitor

Hi everyone, is there a REST call (or another way) that i can make to cloudera manager to fetch the alerts only ? 

Also, i figured that when there's an alert, the Alert Publisher custom script is called with a json containing all the alerts as an arguments, how can I get that json ? 

 

thanks, 

Karim

1 ACCEPTED SOLUTION

avatar
Super Collaborator
CM API request is an authenticated request to CM server which will be audit logged. One option for you may be to use a dedicated username for your CM API queries, and filter out this username in your query filter.

View solution in original post

3 REPLIES 3

avatar
Super Collaborator
By default no custom alert script is used, this has to be explicitly configured. Is alert email delivery or SNMP alerting not sufficient for your use case?

See https://www.cloudera.com/documentation/enterprise/5/latest/topics/cm_dg_alerts.html

Alternatively you can use the CM API to query events, a query filter like "alert==true" will retrieve only those events which are tagged as alert.

For more info how to use the CM API please see

http://cloudera.github.io/cm_api/
https://archive.cloudera.com/cm6/6.0.0/generic/jar/cm_api/apidocs/resource_EventsResource.html

avatar
Visitor

Hi gzigldrum

Thanks for your answer, 

that's what i'm doing now, but everytime i do a call to /events endpoint using a basic authentication, it add the authentication event to the list as a "AUDIT_EVENT", is there a way to not add the audit events to the events list ?

avatar
Super Collaborator
CM API request is an authenticated request to CM server which will be audit logged. One option for you may be to use a dedicated username for your CM API queries, and filter out this username in your query filter.