Sound notification on nagios server
Marcio Merlone
marcio at ambientebrasil.com.br
Thu Dec 15 14:04:02 CET 2005
On Qua, 2005-12-14 at 22:39 +0100, Arno Lehmann wrote:
> > On Qua, 2005-12-14 at 18:24 -0200, Marcel Mitsuto Fucatu Sugano wrote:
> >>On Wed, 2005-12-14 at 11:46 -0200, Marcio Merlone wrote:
> >>>Yes, but this regards only for web clients browsing nagios, and it is
> >>>working fine. BUT, I want the sound to be played on the nagios server,
> >>>not my workstation.
> >>
> >>Nagios user has permissions on whatever /dev/dsp devices?
> More general approach: Try running your notification script as the user
> nagios runs as. Or put it in a wrapper script that uses su or sudo to
> execute the siren-script as, for example, root. That might give you some
> clues... I guess it's a permissions problem you encounter.
When Mr. Mitsuto said something about permissions, I checked all
possibilities, and made this:
root at cedro:/etc/nagios# su - nagios -s /bin/bash
nagios at cedro:~
$ /usr/bin/aplay /usr/share/nagios/htdocs/media/critical.wav
Playing WAVE '/usr/share/nagios/htdocs/media/critical.wav' : Unsigned 8
bit, Rate 11025 Hz, Mono
nagios at cedro:~$
It made a sound! But:
root at cedro:/etc/nagios# su - nagios -c
"/usr/bin/aplay /usr/share/nagios/htdocs/media/critical.wav"
root at cedro:/etc/nagios#
This makes nothing. Anyway, it is clear that the nagios user is able to
access /dev/dsp, since it played the sound on the first attempt.
> Permissions on aplay, the wav file, or anything else? An aplay ...
> >>/var/log/buzina.log might also show some error messages.
I made that also, but no output to the log from aplay, just the echo
"Playing" >> log...
Should I give up? :) I refuse to!
--
Marcio Merlone <marcio at ambientebrasil.com.br>
Ambiente Brasil
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list