Reply
New Contributor
Posts: 2
Registered: ‎05-17-2016

How to change subject prefix for email alerts?

I have 3 clusters running in our environment. And I have configured the alert publisher on cloudera manager to send alert emails. This setup works well. 

However all the email that comes have default subject prefix [Cloudera Alert], which confuses sometimes to identify the cluster. I am looking for settings where I can change the subject prefix to add [Prod Cloudera Alert] or [Stage Cloudera Alert] etc. 

 

Appreciate if someone can share configuration details for this change.

Cloudera Employee
Posts: 289
Registered: ‎07-08-2013

Re: How to change subject prefix for email alerts?

This is possible only through Configuring Custom Alerts [1]  - you'd need to create a script that parses the alert json file and send an email. 

 

eg: a sample shell script will send an alert containing the full jsong of the alert, with a subject: "Alert: _YOUR_CLUSTER_NAME_"

 

 

[alert]# cat custom_alert.sh
#!/usr/bin/env bash
CLUSTER_NAME=`cat $1 | python -c 'import sys, json; print json.load(sys.stdin)[0]["body"]["alert"]["attributes"]["CLUSTER_DISPLAY_NAME"]'`
cat $1 | mail -s "Alert: $CLUSTER_NAME" "root@localhost"

 

[1] http://www.cloudera.com/documentation/enterprise/5-6-x/topics/cm_ag_alert_script.html#concept_sfx_lk...

New Contributor
Posts: 2
Registered: ‎05-17-2016

Re: How to change subject prefix for email alerts?

And it would require enterprise license as mentioned in the URL?

Cloudera Employee
Posts: 289
Registered: ‎07-08-2013

Re: How to change subject prefix for email alerts?

I am running CM Express edition and don't see that being enforced, did you notice otherwise?

Announcements