Sound notification on nagios server
Marcio Merlone
marcio at ambientebrasil.com.br
Wed Dec 14 13:32:42 CET 2005
Hello all.
I searched the web for this but could not find a proper solution. I am
trying to make the nagios server (not the web gui) play a sound when
there is something wrong. In this effort, I set:
misccommands.cfg:
define command{
command_name play_siren
command_line /sbin/sirene.sh
}
/sbin/sirene.sh:
#!/bin/bash
data=`date`
echo "$data Making noise" >> /var/log/buzina.log
/usr/bin/aplay -q /usr/share/nagios/htdocs/media/critical.wav
contacts.cfg:
define contact{
contact_name sirene
alias Sound card on sever
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,u,r
service_notification_commands play_siren
host_notification_commands play_siren
email info at domain.tld
}
contactgroups.cfg:
define contactgroup{
contactgroup_name buzina
alias Placa de som na cedro
members sirene
}
hosts.cfg:
define host{
use generic-host
host_name teste
alias Just for fun
address 10.0.0.124
check_command check-host-alive
max_check_attempts 20
notification_interval 60
notification_period 24x7
notification_options d,u,r
}
services.cfg:
define service{
use generic-service
hostgroup_name teste
service_description PING
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups router-admins,buzina
notification_interval 240
notification_period 24x7
notification_options c,r
check_command check_ping!100.0,20%!500.0,60%
}
I have a sound card attached to the server, and issuing this command by
hand I can hear the sound. But when the test server is down the command
is not executed. The machine is an ubuntu 5.10 running kernel
2.6.12-10-k7, and nagios-mysql 1.3-cvs.20050402-4ubuntu3.
Please let me know if you need further information. Thanks in advance
for any help or hint.
Best regards,
--
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