Skip to content

Feature/sse html5 notifications#25

Closed
udragon wants to merge 8 commits intoIcinga:masterfrom
udragon:feature/sse-html5-notifications
Closed

Feature/sse html5 notifications#25
udragon wants to merge 8 commits intoIcinga:masterfrom
udragon:feature/sse-html5-notifications

Conversation

@udragon
Copy link
Copy Markdown

@udragon udragon commented Apr 25, 2015

Hello guys,
I wanted to add html5 web notifications when new alerts arrive. I needed this feature for my operation center team, so I learned the code a little bit and contributed :-)

I implemented a few things for this to happen:

  1. SSE ("Server-sent event") application on server side, saving notifications in file and read new notifications when it changes.
  2. client-side html5 notifications, just like gmail. with sound and icon.
  3. I wanted the notifications to be role-based, so I implemented the method User::getRoles().
  4. The notification data has to arrive from somewhere. I chose to rely on icinga2 notification scripts to do that.

so, In short, the notification flows this way:
icinag2 notification script --> sse.php --> events file
events file --> sse.php --> JS EventSource --> JS Notification

Hope that's clear. I'm sure you will want to do some changes, feel free.
I didn't thought about security here, so you probably will want to add a token here for adding a new event.

Edit : I looked at this more carefully and I think better base my notifications on the monitoring module notifications. I close this pull request and open a new one when I finish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant