how can play an alarm or bib with warning or critical

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.
baber
Posts: 295
Joined: Wed Oct 21, 2015 4:39 am

how can play an alarm or bib with warning or critical

Post 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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

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

Post 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.
Former Nagios Employee
baber
Posts: 295
Joined: Wed Oct 21, 2015 4:39 am

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

Post 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 ?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

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

Post 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
Former Nagios employee
User avatar
nozlaf
Posts: 172
Joined: Sun Nov 09, 2014 9:50 pm
Location: Victoria, Australia

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

Post 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
Looking forward to seeing you all at #NagiosCon2019?
-Dedicated Lover of Nconf,PNP4Nagios and Nagvis
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

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

Post 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.
Former Nagios Employee
baber
Posts: 295
Joined: Wed Oct 21, 2015 4:39 am

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

Post 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 ?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

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

Post 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
Former Nagios Employee
baber
Posts: 295
Joined: Wed Oct 21, 2015 4:39 am

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

Post 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
Attachments
cgi.cfg
(12.33 KiB) Downloaded 386 times
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

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

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked