Page 2 of 4
Re: how can play an alarm or bib with warning or critical
Posted: Thu Aug 04, 2016 2:02 am
by baber
lmiltchev wrote:According to the Nagios Core documentation:
Audio files are assumed to be in the media/ subdirectory in your HTML directory (i.e. /usr/local/nagios/share/media).
You will need to place the audio files (hostu.wav, hostd.wav, critical.wav, warning.wav, and unknown.wav) in the "/usr/local/nagios/share/media" directory. Next, you will need to modify the cgi.cfg file by changing this:
Code: Select all
Formats: host_unreachable_sound=<sound_file>
host_down_sound=<sound_file>
service_critical_sound=<sound_file>
service_warning_sound=<sound_file>
service_unknown_sound=<sound_file>
Examples: host_unreachable_sound=hostu.wav
host_down_sound=hostd.wav
service_critical_sound=critical.wav
service_warning_sound=warning.wav
service_unknown_sound=unknown.wav
to this:
Code: Select all
host_unreachable_sound=hostu.wav
host_down_sound=hostd.wav
service_critical_sound=critical.wav
service_warning_sound=warning.wav
service_unknown_sound=unknown.wav
Restart nagios and apache. Let us know if you have any more questions.
thanks
now i have coy a wav file in this path
Code: Select all
/usr/local/nagios/share/media/warn.wav
and add these line at the end of cgi.cfg file and restart nagios service and httpd but now i have a critical alarm on my nagios but not play any alarm
why ?
Code: Select all
Formats: host_unreachable_sound=<sound_file>
host_down_sound=<sound_file>
service_critical_sound=<sound_file>
service_warning_sound=<sound_file>
service_unknown_sound=<sound_file>
Examples: host_unreachable_sound=hostu.wav
host_down_sound=hostd.wav
service_critical_sound=/usr/local/nagios/share/media/warn.wav
service_warning_sound=warning.wav
service_unknown_sound=unknown.wav
Re: how can play an alarm or bib with warning or critical
Posted: Thu Aug 04, 2016 9:20 am
by rkennedy
What is the output of ls -l /usr/local/nagios/share/media/?
Re: how can play an alarm or bib with warning or critical
Posted: Thu Aug 04, 2016 11:15 am
by baber
rkennedy wrote:What is the output of ls -l /usr/local/nagios/share/media/?
Code: Select all
[root@nagios media]# ls -l /usr/local/nagios/share/media/
total 12
-rw-r--r--. 1 root root 9960 Aug 4 10:45 warn.wav
[root@nagios media]#
Re: how can play an alarm or bib with warning or critical
Posted: Thu Aug 04, 2016 11:17 am
by rkennedy
That should be fine, but what are the permissions on the folder above it? Does the nagios user have permission to open that folder?
Also -- just to clarify, are you looking for sounds to play on your computer OR off the server?
Re: how can play an alarm or bib with warning or critical
Posted: Thu Aug 04, 2016 11:35 am
by baber
rkennedy wrote:That should be fine, but what are the permissions on the folder above it? Does the nagios user have permission to open that folder?
Also -- just to clarify, are you looking for sounds to play on your computer OR off the server?
this is my permission for that folder
Code: Select all
drwxrwxr-x. 2 nagios nagios 4096 Aug 4 11:28 media
what do you mean about (are you looking for sounds to play on your computer OR off the server)
Re: how can play an alarm or bib with warning or critical
Posted: Thu Aug 04, 2016 2:02 pm
by rkennedy
Got it, could you also post the output of this?
"grep wav /usr/local/nagios/etc/cgi.cfg"
what do you mean about (are you looking for sounds to play on your computer OR off the server)
Are you looking to have YOUR computer play the sound, or have the server that is running Nagios play the sound?
Re: how can play an alarm or bib with warning or critical
Posted: Thu Aug 04, 2016 2:15 pm
by baber
rkennedy wrote:Got it, could you also post the output of this?
"grep wav /usr/local/nagios/etc/cgi.cfg"
what do you mean about (are you looking for sounds to play on your computer OR off the server)
Are you looking to have YOUR computer play the sound, or have the server that is running Nagios play the sound?
Code: Select all
[root@nagios nagios]# grep wav /usr/local/nagios/etc/cgi.cfg
#host_unreachable_sound=hostdown.wav
#host_down_sound=hostdown.wav
#service_critical_sound=critical.wav
#service_warning_sound=warning.wav
#service_unknown_sound=warning.wav
#normal_sound=noproblem.wav
Examples: host_unreachable_sound=hostu.wav
host_down_sound=hostd.wav
service_critical_sound=/usr/local/nagios/share/media/warn.wav
service_warning_sound=warning.wav
service_unknown_sound=unknown.wav
[root@nagios nagios]#
this is not important for me play music from nagios or pc which of them is better and easier ?
my nagios server is on a virtual machine
Re: how can play an alarm or bib with warning or critical
Posted: Thu Aug 04, 2016 3:00 pm
by rkennedy
Change this -
to (since you're file is called warn.wav) -
Then restart nagios, and it should play a sound if you load the services page and see a status that is in a warning state, it will play a sound. I just tested on my end and it works as expected.
Re: how can play an alarm or bib with warning or critical
Posted: Thu Aug 04, 2016 3:48 pm
by baber
rkennedy wrote:Change this -
to (since you're file is called warn.wav) -
Then restart nagios, and it should play a sound if you load the services page and see a status that is in a warning state, it will play a sound. I just tested on my end and it works as expected.
Since that i don' t have warning alarm and have warning add this line
Service_critical_sound=warn.wav
And then restart nagios service and httpd but not work i previously said my nagios server is on virtual machine and i don't have sound card on my server or vm is that important ?
Can say play music from pc ??
Re: how can play an alarm or bib with warning or critical
Posted: Thu Aug 04, 2016 4:04 pm
by tgriep
The sound will play on your PC and not the server. As long as you have a web browser open to the Nagios system and a status changes, it will play the sound file on that PC.