Support Questions

Find answers, ask questions, and share your expertise

Post Ambari alerts on slack.

avatar
Contributor
 
1 ACCEPTED SOLUTION

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

View solution in original post

4 REPLIES 4

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

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

avatar
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]

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