Nagios core 3.4.1 - Audio alerts command fails

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
techwin
Posts: 2
Joined: Wed Nov 28, 2012 4:45 am

Nagios core 3.4.1 - Audio alerts command fails

Post by techwin »

I've configured nagios core 3.4.1 on centos 5.1 server and everything works fine including alert emails. Now, I am trying to configure the audio alerts with the given below configuration.

define command{
command_name play_siren
command_line /bin/bash /usr/local/nagios/etc/objects/play_siren.sh
}
-----------------------------------------------------------

#vi play_siren.sh

#!/bin/bash
/usr/bin/aplay -q /usr/share/nagios/etc/objects/alarm.wav
---------------------------------------------------

define contact{
name generic-contact
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r,f,s
host_notification_options d,u,r,f,s
service_notification_commands notify-service-by-email,play_siren
host_notification_commands notify-host-by-email,play_siren
register 0
}
-----------------------------------------------------
Whenever the alert triggers the email is sent but no audio is played.
when I run the file from shell ,ie. #/usr/local/nagios/etc/objects/play_siren.sh , it plays well.

In message log I get the logs like:

Nov 28 15:19:35 monitor nagios: HOST NOTIFICATION: nagiosadmin;inet-corp;DOWN;notify-host-by-email;CRITICAL - Packet Filtered (8.8.8.8)
Nov 28 15:50:35 monitor nagios: HOST NOTIFICATION: nagiosadmin;inet-corp;DOWN;play_siren;CRITICAL - Packet Filtered (8.8.8.8)
But no sound!
Please help.
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: Nagios core 3.4.1 - Audio alerts command fails

Post by jsmurphy »

If you su to the Nagios user and try to run the play_siren.sh does it work? My thinking currently is that it possibly doesn't have permissions to execute either the script itself or /usr/bin/aplay
techwin
Posts: 2
Joined: Wed Nov 28, 2012 4:45 am

Re: Nagios core 3.4.1 - Audio alerts command fails

Post by techwin »

Thank you!

It was permission problem.

#chmod 777 -R /dev/snd

It solved the problem!
Locked