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.

Post Ambari alerts on slack.

Solved Go to solution

Post Ambari alerts on slack.

New Contributor
 
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Post Ambari alerts on slack.

Super Collaborator

If you're asking if you can take Ambari Alerts and publish them using PutSlack, I think what you're looking for is a script dispatcher:

https://cwiki.apache.org/confluence/display/AMBARI/Creating+a+Script-based+Alert+Dispatcher

When Ambari triggers an alert, it can invoke a custom python script. We used to use this for dispatching SNMP notifications before it was its own supported type. But you could use it for anything, including pushing data to a URL.

4 REPLIES 4

Re: Post Ambari alerts on slack.

Mentor

you can combine Ambari Rest API with Nifi and it's built-in PutSlack processor to achieve what seems to be what you're asking from your post.

https://github.com/apache/ambari/blob/branch-2.1/ambari-server/docs/api/v1/alert-definitions.md

https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi.processors.slack.PutSlack/index.ht...

Re: Post Ambari alerts on slack.

Super Collaborator

If you're asking if you can take Ambari Alerts and publish them using PutSlack, I think what you're looking for is a script dispatcher:

https://cwiki.apache.org/confluence/display/AMBARI/Creating+a+Script-based+Alert+Dispatcher

When Ambari triggers an alert, it can invoke a custom python script. We used to use this for dispatching SNMP notifications before it was its own supported type. But you could use it for anything, including pushing data to a URL.

Re: Post Ambari alerts on slack.

New Contributor

Hi @Jonathan Hurley

Is there any way to get the host name in which the state service changed along with the other definitions that were given in the python script at your given link? I'm able to see notifications going to my my slack channels with the ones below but I still need the hostname definition as a separate definition, any idea?

definitionName = sys.argv[1] definitionLabel = sys.argv[2] serviceName = sys.argv[3] alertState = sys.argv[4] alertText = sys.argv[5]

Re: Post Ambari alerts on slack.

Super Collaborator

Currently no, there is not. I believe there is a Jira open for changing how we send arguments to a script dispatcher so they are parameterized. Some fields, such as host name and component name, are not always present, so the current model simply omits them.