shinken-monitoring / mod-webui

Shinken Web User Interface
GNU Affero General Public License v3.0
79 stars 71 forks source link

Alarm sound won't play in dashboard currently #327

Closed vizvayu closed 9 years ago

vizvayu commented 9 years ago

The alarm is not working when viewing the dashboard currently.

vizvayu commented 9 years ago

Actually it seems this is not working on the regular dashboard either. Aparently the how_many_problems_actually variable is not getting updated with the AJAX refreshes, only with a full reload. Maybe because it's assigned by the template...

mohierf commented 9 years ago

Thanks for your report! I am really interested in your testings of this dashboard feature ...

I will have a look tomorrow!

PS: you opened the very first issue on the new Web UI version :smile:

vizvayu commented 9 years ago

Yes I just noticed. Congrats for the release, and thank you for all your hard work. Webui is getting better than ever. I've been doing some quick tests about this but I can't really figure out how to get the data from shinken without having to reload the whole chain of templates... hope you'll find a solution, we'd really like to have an alarm.

mohierf commented 9 years ago

I found a solution and I am currently testing ...

mohierf commented 9 years ago

I merged the PR https://github.com/shinken-monitoring/mod-webui/pull/333 in the develop branch.

This PR improves the refresh for header bar and currently page, and a sound is played when the overall problems (host + service) increased since the last refresh.

vizvayu commented 9 years ago

Great, it is working now, thanks! A small detail is that it sounds only after the next refresh after detecting the alarm. I.E. I have the refresh_period set to 30 seconds... so the alarm shows up and then, 30 seconds after that, the alarm sound starts. I had to manually patch the files, the dev branch wasn't working for me... probably have to change something somwhere but I don't know (maybe the name of the module?).

mohierf commented 9 years ago

1/ I do not have the same behaviour as yours ... the sound is played in the same refresh beat as the problems number is increased !

2/ which file did you patched ? I am interested in it ... because the develop branch is the one currently on my testings environment :/P This should probably explain the sound refresh problem ... please provide more information about your patches.

vizvayu commented 9 years ago

1- About this I'll try and do some more testing on a different computer to see if anything changes 2- I patched these files: module/htdocs/js/shinken-refresh.js module/plugins/dashboard/views/currently.tpl module/views/header_element.tpl From commits 746e5c3 and 0f7132c

mohierf commented 9 years ago

Ok, the patches should be enough ... keep me informed about your tests results.

vizvayu commented 9 years ago

Ok I tested it using a different computer and the results are that when using the standard dashboard the sound plays at the exact moment when the visual alarm is displayed, but when using the currently dashboard, the sound plays at the next refresh cycle after the visual alarm was displayed. This is consistent on both computers. I also downloaded and completely replaced the changed files to avoid any patching errors.

mohierf commented 9 years ago

I will make some more tests on the currently dashboard page ...

I still noticed something: on Shinken restarts the application still stored a problems number and the very first page refresh is needed to update with the new problems number. We will always miss the first refresh on Shinken restart ...

This afternoon I already saw some interesting improvements between python and javascript to clean this page ...

mohierf commented 9 years ago

@vizvayu : I made some more tests yesterday evening and this morning and it is ok on my testing environment ... we merged a PR this morning in the develop branch of the project.

I am interested in your feedback ...

image

vizvayu commented 9 years ago

Now everything seems to be working perfectly, thank you! And the visual messages are a good idea.

mohierf commented 9 years ago

Thanks for your testing