Nagios core 3.4.1 - Audio alerts command fails
Posted: Wed Nov 28, 2012 5:22 am
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.
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.