Publish Ambari Alerts to Google Cloud Messaging using Ambari Alert Dispatcher


Apache Ambari is a powerful open source cluster management tool, which simplifies deploying and managing Big Data clusters.

Ambari Server has an in-built alert management which triggers alerts based on conditions set.

The simplest alert example is the one defined for data node process unreachable. This alert is triggered whenever datanode process is down. The following snapshot shows the details of this alert.

Alerts are good however what use has an alert unless it can be notified to end users automatically. I started exploring Ambari to identify if there is a way by which I can define a custom dispatcher for alert events.

And viola I discovered that Ambari has an inbuilt “Alert Dispatcher” which has to be activated and we can define a call back script which will be invoked by the dispatcher .

Here comes the interesting part on how I went about using Ambari alert dispatcher to trigger Google cloud notifications for Android .

Lets look at how to enable Alert dispatcher on Ambari server .

  • Create an alert dispatcher target on Ambari server, but before that check if there is one already defined. check if default alert dispatcher target is already defined , by using following curl command

curl –u admin:password –I –H ‘X-Requested-By:ambari’

Output should be empty JSON.

  • Define your own alert dispatcher target, using following curl statement the settings are part of http payload.

curl -u admin:password -i -H ‘X-Requested-By: ambari’ -X POST -d ‘{“Body”:{“AlertTarget”: {“name”: “syslogger”,”description”: “Syslog Target”,”notification_type”: “ALERT_SCRIPT”,”global”: true}}}’

  • Now the target is set ,  let us bind the dispatcher script that has our code to ambari server

On Ambari server properties file (/etc/ambari-server/conf/ define the following property and it should point to a python or bash script which has your actions defined.


I  used this property to invoke a GCM module written in python .

** if you want to use my python code as an example its available in following git repository

  • Restart Ambari server

ambari-server restart

Now its time to put the module to test , trigger an alert by stopping HDFS service from Ambari .

Congratulations we just published Ambari alerts to Android applications.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s