Page 1 of 4

how can play an alarm or bib with warning or critical

Posted: Thu Jun 23, 2016 9:48 am
by baber
dear all

Hi

i want to know how can set alarm for nagios means when a service or host appear with warning or critical play a bib or alarm ?

Best regards
Babak

Re: how can play an alarm or bib with warning or critical

Posted: Thu Jun 23, 2016 11:57 am
by rkennedy
What machine are you trying to play a sound on? With the Nagios server, you should just be able to create a command that plays a sound on the local machine.

Re: how can play an alarm or bib with warning or critical

Posted: Thu Jun 23, 2016 12:22 pm
by baber
rkennedy wrote:What machine are you trying to play a sound on? With the Nagios server, you should just be able to create a command that plays a sound on the local machine.
i just want when any warning or critical appear in nagios alam or horn play

where do i have to config that ?

Re: how can play an alarm or bib with warning or critical

Posted: Thu Jun 23, 2016 1:21 pm
by tmcdonald
Again, we need to know what machine should play the sound. The implementation is going to be different depending on whether you want the sound to come from your browser, or from the server that hosts Nagios.

If you want this played on the Nagios server: http://askubuntu.com/questions/83200/ho ... ifications
Otherwise from your browser: https://assets.nagios.com/downloads/nag ... dio_alerts

Re: how can play an alarm or bib with warning or critical

Posted: Thu Jun 23, 2016 9:17 pm
by nozlaf
doing this with nagvis is perhaps the easiest way to do it
default action for nagvis is to play an annoying noise whenever anything on the map turns red

Re: how can play an alarm or bib with warning or critical

Posted: Fri Jun 24, 2016 9:21 am
by rkennedy
Take a look at the options @mcdonald mentioned, and @nozlaf as well - let us know if you have any further questions about it.

Re: how can play an alarm or bib with warning or critical

Posted: Fri Jun 24, 2016 9:30 am
by baber
tmcdonald wrote:Again, we need to know what machine should play the sound. The implementation is going to be different depending on whether you want the sound to come from your browser, or from the server that hosts Nagios.

If you want this played on the Nagios server: http://askubuntu.com/questions/83200/ho ... ifications
Otherwise from your browser: https://assets.nagios.com/downloads/nag ... dio_alerts

excusem i have read audio from browser but realy could not understand that means which file do i have to edit?

can you giva me an example for example if appear a warning about memory appear in my nagios i want play alarm realy confused what do i have to edit that work for all services and hosts ?

Re: how can play an alarm or bib with warning or critical

Posted: Fri Jun 24, 2016 12:04 pm
by rkennedy
You'll want to make the change to your cgi.cfg -

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

Re: how can play an alarm or bib with warning or critical

Posted: Fri Jun 24, 2016 3:20 pm
by baber
rkennedy wrote:You'll want to make the change to your cgi.cfg -

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
i have added this code in the end of my cgi.cfg file but nothing do i am using mozilla firefox 43.0.1 and attached cgi.cfg file



So thanks

I have to copy and paste exactly that code in the end of cgi.cfg file?

Instead of warning.wav what do i have to write ?? Path of warning.wav file ? How can wrie?

Warm regards

Re: how can play an alarm or bib with warning or critical

Posted: Mon Jun 27, 2016 10:05 am
by lmiltchev
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.