Sound alerts on Grafana 9

Hello! I know grafana doesnt support sound alerts, I saw an script here in the forum, but doesnt work for me in the 9 lastest version of grafana.
Does any here knows any 3rd party app to make it work?
We have a tv with our panels but not always are looking at the screen, so we need a simple sound for the alerts so we can check what its happening.
Hope anyone can helpme.
thanks for any info!

Hi @rogerfor7 and welcome to the Grafana forum.

There are probably many ways to do this, but personally I would set up a webhook contact point…

…then run Node-RED on the computer that is being displayed on your TV. Then, use Node-RED to receive the webhook and play a given audio file once an alert is received. Because Node-RED can pretty much do anything (except make you breakfast), you can also have lights flash, Tweets sent out, etc.

I actually have been meaning to do this myself, so will report back on this thread once I have it up and running.

1 Like

I really appreciate your help, thank you so much, I will try this, and will update too if I can do it.
Thanks a lot @grant2

@rogerfor7

Well this did not take long at all. Here’s what I did:

  1. Set up Webhook contact point (leave all other settings blank…just remember to select POST in the HTTP method)

  2. Test the alert by clicking on the blue button

  3. Over on 192.168.10.235:1880, where we have Node-RED running with the flow shown below, the audio file (whose path is specified in the brown node called “sound”) will be played whenever a webhook is received. In my case, I just left the existing filepath and filename (D:\Documents\Music\etc…) which does not exist, but of course I could load an audio file of my choice and then just change the path. The file will then be played on the computer running Node-RED whenever a webhook alert is received.

1 Like

Thank you so much, I’m trying but till know im getting a “Failed to send test alert.: webhook response status 404 Not Found” I never usted node-red or node, so probably im doing something wrong, but I will keep trying, I really appreciate your time.

@rogerfor7

Remember the webhook URL that you specify in Grafana alert contact setup:
http://192.168.10.235:1880/hello

must match Node-RED (running at 192.168.10.235:1880) HTTP In node:

and both should have POST selected.

My problem was that I was using the “http request” instead only http, once was changed, it works like charm, thank you so much for all your help, you are the best!
I really appreciate all the help.

Awesome! I’ll try to post back here with a demo.

Nice solution. It is exactly what I need. But under contact type I have only email.
Is there anything that shall be changed in the configuration of Grafana to add/show the other types of contact types?

Which version of Grafana are you using? You should see something like this if using one of the more recent releases…
image

1 Like

Looking at the screenshot you posted, I found it.
Thank a million. Your solution is awesome and fits exactly my need since I need to trigger a relay on the Pi hosting Grafana.
Thanks

1 Like

Hi @grant2 , Could you provide this flow.json, I`m not familiar with Node-RED.
I appreciate it.

@km5210 I deleted that months ago, but if you spend a few minutes learning the basics of building a flow in Node-RED, you will be able to build this very quickly. If you need help, their forum is great.

It might be interesting to inject Node-RED-webhook into grafana’s /usr/share/grafana/public/views/index.html

@grant2 I tried to implement your method and it doesn’t work for me.
This is what I did, do you see my mistake?

image

Thank you for your help

Does your Node-RED install have any of the (recently introduced) security / password / authorization parameters configured?

@grant2 No, it’s deployed without authentication settings, anyone is supposed to be able to have access.

Everything looks good acc. to your screenshots. The error message you are getting indicates that Node-RED is refusing the connection.