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.

How to change subject prefix for email alerts?

How to change subject prefix for email alerts?

New Contributor

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.

3 REPLIES 3

Re: How to change subject prefix for email alerts?

Super Collaborator

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

Re: How to change subject prefix for email alerts?

New Contributor

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

Highlighted

Re: How to change subject prefix for email alerts?

Super Collaborator

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