Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

REST call for alerts only

SOLVED Go to solution

REST call for alerts only

New Contributor

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

Accepted Solutions
Highlighted

Re: REST call for alerts only

Expert Contributor
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.
3 REPLIES 3

Re: REST call for alerts only

Expert Contributor
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

Re: REST call for alerts only

New Contributor

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 ?

Highlighted

Re: REST call for alerts only

Expert Contributor
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.