Reply
New Contributor
Posts: 3
Registered: ‎11-06-2018
Accepted Solution

REST call for alerts only

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

Cloudera Employee
Posts: 48
Registered: ‎01-15-2015

Re: REST call for alerts only

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
New Contributor
Posts: 3
Registered: ‎11-06-2018

Re: REST call for alerts only

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 ?

Cloudera Employee
Posts: 48
Registered: ‎01-15-2015

Re: REST call for alerts only

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.
Announcements