Pivotal HD - How to personalize the email messages sent by Ambari alerts
search cancel

Pivotal HD - How to personalize the email messages sent by Ambari alerts

book

Article ID: 295005

calendar_today

Updated On:

Products

Services Suite

Issue/Introduction

The default template used by Ambari alerts contains only limited information and may need to be personalised. For example, the "cluster name" may need to be added to the subject of the email, this knowledge base article explains how to modify the standard Ambari alerts template.

Environment


Resolution

1. Locate the Ambari-server jar file by default located in /usr/lib/ambari-server/ambari-server-2.1.2.2.163.jar.

2. Extract the Ambari alerts template:

[root@phd301 ambari-server]# cd /usr/lib/ambari-server/
[root@phd301 ambari-server]# /usr/jdk64/jdk1.8.0_40/bin/jar xf ambari-server-2.1.2.2.163.jar alert-templates.xml
[root@phd301 ambari-server]# ls -ltr
total 24680
-rw-r--r--. 1 root root 5185 Nov 12 2015 alert-templates.xml
-rw-r--r--. 1 root root 25262280 May 13 16:00 ambari-server-2.1.2.2.163.jar
[root@phd301 ambari-server]#

 

3. Edit the template as needed,template variables can be used if need be.

4. Edit the Ambari properties file:/etc/ambari-server/conf/ambari.properties to add in the line:

alerts.template.file=/usr/lib/ambari-server/alerts.templates.xml

 

Note: the location may be anywhere Ambari has access to.

5. Restart Ambari-server:

[root@phd301 ~]# ambari-server restart
Using python /usr/bin/python2.6
Restarting ambari-server
Using python /usr/bin/python2.6
Stopping ambari-server
Ambari Server stopped
Using python /usr/bin/python2.6
Starting ambari-server
Ambari Server running with administrator privileges.
Organizing resource files at /var/lib/ambari-server/resources...
Server PID at: /var/run/ambari-server/ambari-server.pid
Server out at: /var/log/ambari-server/ambari-server.out
Server log at: /var/log/ambari-server/ambari-server.log
Waiting for server start....................
Ambari Server 'start' completed successfully.
[root@phd301 ~]#