Page 1 of 1

Setting Notifications in a queue

Posted: Thu May 03, 2018 8:30 am
by smersh
Hello,
I'm using acoustic notifications as it's described in the following document:

https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Everything works fine until Nagios send multiple alerts simultaneously, when a multiple number of problems rise. In this situation the Raspberry executes playback of all receives alerts together.

Is it possible to set Nagios to send notifications in a queue?

Regards
Nick

Re: Setting Notifications in a queue

Posted: Thu May 03, 2018 9:16 am
by eloyd
You would have to implement such a thing yourself. Not sure how you're using the Pi exactly, but if you're just alerting based on email, you could use procmail to take the email, parse it appropriately, then write into a file on your local Pi filesystem. Then have a "reaper" process that looks at the file every 10 seconds (or whatever) and processes thing in it in sequence. Poor man's queue, but it would work.

Re: Setting Notifications in a queue

Posted: Thu May 03, 2018 10:25 am
by tmcdonald
smersh wrote:Is it possible to set Nagios to send notifications in a queue?
Technically speaking there is a queue of sorts in that notification events are processed from the DB, but they're just processed really quickly so it seems like a burst. Putting a program-wide delay between notifications could cause a huge backlog in which really important notifications would be caught up.

Re: Setting Notifications in a queue

Posted: Thu May 03, 2018 5:00 pm
by smersh
Looks like I have found the solution.
It's a task-spooler (tsp for Debian) which takes control of the batch execution automatically.

In my case the wrapper at the alert receiving side (RPi) executes tsp aplay ... . The tsp puts every alert in a queue, executing the next one after the previously executed ends.

Very easy and effective.

Regards!
Nick.

Re: Setting Notifications in a queue

Posted: Fri May 04, 2018 9:04 am
by tmcdonald
Glad to hear it! Are we good to mark this as resolved?

Re: Setting Notifications in a queue

Posted: Sat May 12, 2018 2:24 am
by smersh
Yes, thank you!
NJ