Grafana: [FEATURE request] Play Sound on alert activation

Created on 1 Dec 2016  ·  82Comments  ·  Source: grafana/grafana

Hello,

it would be great if there is an option to play a sound after a alerting rules activate.
Maybe an activation field in the alter tab, where you can choose between 2 or 3 sounds?

think this would be a great feature :)

Greets,
Max

Edit 07/11/2019: Viniston and I wrote a function to alert ( look in comments: https://github.com/grafana/grafana/issues/6778#issuecomment-550856960 )

Thank you very much to Viniston :-)

arealerting prioritunscheduled typfeature-request

Most helpful comment

REOPEN Feature request. A new year, fresh eyes. Please.

All 82 comments

where is the problem? Just add yourself a webhook to play the sound using the webhook alerting feature ;)

@flyersa

hey fly,
never worked with webhooks before. any suggestion where to start? :)

pls show me some example if you played sound

+1 for out of the box functionality for sound on new alert in the browser

+1 I hope so too

+1

It will be very helpfull

I think it will be a good function too. Since I am really needing it right now. 🤣 🤣 🤣

has play sound function been implement?

Please implement this!!!!!

+1

+1

+1

+1

After some internal discussions, we agreed that this is not something we want to support in core Grafana. But since Grafana has support for panel plugins it's possible to develop a new plugin that extends the alert list panel or a new plugin for playing alert sounds.

But you support Alerts! How hard is it to play a .wav when the panel is flashing?

I think he has the point, it should be supported in the panel, and I think that is what we asked for, not the Grafana core but the panels one. Most of us are using the default panels anyway.

We need it too! +1

@bergquist how about alerting using desktop notification when?

REOPEN Feature request. A new year, fresh eyes. Please.

+1

+1

+1

+1
definitely wanted feature,
maybe extension of Grafana Alerting API with combination of POST webhook would be a good aproach ?

+1
When the Grafana dashboard is projected in a Control Room, NOC, SOC.... together with other Monitors, it is valuable to have sounds when Grafana alert occurs.

+1 implement this. i run grafana on a video wall monitoring critical systems. an alert prompting me to look up at the wall would asssist in response times greatly!

+1
This would be a very usefull feature

+1 also our company think its a very good feature to develop and it will help us see the alerts more quickly specially if you are handling lot NOC tools.
@bergquist - any chance of re opening this one as more and more people requesting it.
I don't think its very hard to develop it if you are setting threshold (Min OR Max) and you exceeding it then the alarm will start running the sound.
Looking for you reply.
Tnx
Tamer

+1 I need this

+1 I'm surprised that Grafana does not have this feature.

+1 It is very necessary to use grafana for monitoring large screens.

+1
We need this too! :)

This is basic function, we truly need this.

+1

+1

+1

+1

This is very cool, we need this too! :)

+1 it can be very useful to monitoring IT systems like me.

+1

+1 would be great to have. Grafana has been the management deterrent for years, and a feature like this is definitely something to show off.

+1

+1 must have feature :)

+1

+1
If it is needed very urgently, then we can inject the dynamic JavaScript to play sound on alerting

setInterval(function() {
AlertUsers();
}, 60 * 1000);

function AlertUsers() {
if ($('div').hasClass('panel-alert-state--alerting')) {
var audio = new Audio('http://soundbible.com/grab.php?id=2142&type=mp3');
audio.play();
}
}

Hi everyone,
on the basic from vini @Thx to him :D, i write a small alert activation which you can turn on / off in your browser.

Normal alert rules will trigger an alert sound file + status panels will alert.

Changes:

grafana/public/views/index.html

<div class="main-view"> <- ADD AFTER THIS LINE

   <ul>

    <li><button style="background-color:#f44336;float:left;margin-left:5%;margin-right:5px;color:white;" onmousedown="clearInterval(stopalertt);stopalertt=false;">ALERT OFF</button>

    <button style="background-color:#4CAF50;color:white;" onmousedown="stopalertt=setInterval(AlertUsers, 5000);">ALERT ON</button></li>

    </ul>

At the end of the file (index.html) before /body and /html tag close (after closing script tag)
insert this:

if you want, you could put this in an external js file.

God, this is the worst "WYSIWYG" i ever see. sorry :-/

Greets,
7

Hi everyone,
on the basic from vini @thx to him :D, i write a small alert activation which you can turn on / off in your browser.

Normal alert rules will trigger an alert sound file + status panels will alert.

Changes:

grafana/public/views/index.html

<div class="main-view"> <- ADD AFTER THIS LINE

   <ul>

    <li><button style="background-color:#f44336;float:left;margin-left:5%;margin-right:5px;color:white;" onmousedown="clearInterval(stopalertt);stopalertt=false;">ALERT OFF</button>

    <button style="background-color:#4CAF50;color:white;" onmousedown="stopalertt=setInterval(AlertUsers, 5000);">ALERT ON</button></li>

    </ul>

At the end of the file (index.html) before /body and /html tag close (after closing script tag)
insert this:

if you want, you could put this in an external js file.

God, this is the worst "WYSIWYG" i ever see. sorry :-/

Greets,
7

@7lives83 Looks good

image
How about this option?

@viniston:
Much better :-)

Maybe you want to post the Button Code and where to add?

Thank you,
Greets,
Max

We can choose our sound for alerting

image

add below *li in footer content*

         <li>

             <a href="javascript:void(0);" class="dropdown-alert-on">
               <a href="javascript:void(0);" class="sidemenu-item dropdown dropup alertondropbtn" onclick="alertOn()">
                  <i  class="fa fa-bell"></i>
                    Alert On
                </a>
              <div id="alertOnDropdown" class="dropdown-content-alert-on">
                <a href="javascript:void(0);" onclick="selectedSound=1;stopalert=setInterval(AlertUsers, 5000);">Analog Watch Alarm</a>
                <a href="javascript:void(0);" onclick="selectedSound=2;stopalert=setInterval(AlertUsers, 5000);">Busy Signal</a>
                <a href="javascript:void(0);" onclick="selectedSound=3;stopalert=setInterval(AlertUsers, 5000);">FogHorn Barge</a>
                <a href="javascript:void(0);" onclick="selectedSound=4;stopalert=setInterval(AlertUsers, 5000);">Metal Metronome</a>
                <a href="javascript:void(0);" onclick="selectedSound=5;stopalert=setInterval(AlertUsers, 5000);">Metronome</a>
                <a href="javascript:void(0);" onclick="selectedSound=6;stopalert=setInterval(AlertUsers, 5000);">Teeth Chatter</a>
                <a href="javascript:void(0);" onclick="selectedSound=7;stopalert=setInterval(AlertUsers, 5000);">Turkey Putt</a>
                <a href="javascript:void(0);" onclick="selectedSound=8;stopalert=setInterval(AlertUsers, 5000);">Store Door Chime</a>
              </div>
            </a>
          </li>
          <li>
            <a href="javascript:void(0);" class="sidemenu-item dropdown dropup" onclick="clearInterval(stopalert);stopalert=false;console.log('Interval stopped', stopalert);" >
              <i class="fa fa-bell-o"></i>
              Alert Off
            </a>
          </li>

works :) nice style work! thank you @viniston

works :) nice style work! thank you @viniston
Thank you too @7lives83

one suggestion:

if you change this:

you got a pull up menu :-) but this is only a very small styling tip. not more :) great work vini :)

one suggestion:

if you change this:


you got a pull up menu :-) but this is only a very small styling tip. not more :) great work vini :)

Cool stuff Max :)
image

And the last feature:

add at this point:

<a href="javascript:void(0);" id="alertonbtn" class="sidemenu-item dropdown dropup alertondropbtn" onclick="alertOn()">
<i  class="fa fa-bell"></i>
Alert On
</a>

id="alertonbtn"

add at this point:

<a href="javascript:void(0);" id="alertoffbtn" class="sidemenu-item dropdown dropup" onclick="clearInterval(stopalert);stopalert=false;console.log('Interval stopped', stopalert);" >
<i class="fa fa-bell-o"></i>
Alert Off
</a>

id="alertoffbtn"

in the