|
|
| Browse NETS topics: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z | |
If you have your browser on a Nagios web page like the "Service problems" page, and something goes red, Nagios will make a sound every 60 seconds until the problem is fixed or the NCAR NOC staff acknowledges the problem. The sound happens every 60 seconds because the user's browser refetches the page every 60 seconds. Each time the page is fetched from the Nagios server, if the page contains the "make a sound" tag, the browser will try to make the sound. Some browsers can't make sounds. Of course, the user has to have the volume turned up to hear the sound on their machine.
Nagios lets you turn sounds on or off globally - for all browser users. There isn't a way to configure Nagios to behave differently for different Nagios users. We must have sound generation turned on so that the Nagios users in the NCAR Operations staff hear sounds when there is a problem. This can be irritating for people who run Nagios in their offices, who sometimes get more sound than they want from Nagios :-). They can turn the volume down or off on their entire machine, but naturally they'd like to control the sound that comes out of the browser separately from the sound that comes out of iTunes. Some users simply count on the NCAR NOC staff to acknowledge problems quickly.
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=alf-noproblem.wav
At NCAR, we want:
Whenever a user visits a status.cgi link, or whenever status.cgi updates a page (every 60 seconds), status.cgi plays one sound representing the most critical problem on the page. In the cgi.cfg file, the problem levels appear IN ORDER OF CRITICALITY. So, if you define host_unreachable_sound and host_down_sound and comment-out the others, Nagios will only make a sound if a host is down or unreachable.
The sounds that come with Nagios are:
perl -e 'print "[" . time() . "] PROCESS_HOST_CHECK_RESULT;fl-nagman;2;Pete Siemsen testing, down"' > /var/lib/nagios2/rw/nagios.cmd
To set the same host back up, do
perl -e 'print "[" . time() . "] PROCESS_HOST_CHECK_RESULT;fl-nagman;0;Pete Siemsen testing, up"' > /var/lib/nagios2/rw/nagios.cmd
As of 2008-02-04, this caused Nagios to set fl-nagman's state to "down" and make a noise.
I couldn't get Firefox to make sounds under kubuntu. I finally gave up and installed Ubuntu.
Firefox doesn't let you control sounds in browser pages. Using about:options lets you control the sounds the browser itself generates, like when a mail message arrives, but not sounds that result from tags in the HTML.
Google for "nagioschecker".
Date: Thu, 09 Feb 2006 16:54:27 -0700
From: Lynda McGinley
To: Pete Siemsen
Subject: firefox flsh
http://virtuelvis.com/archives/2005/04/disable-sound-firefox
Date: Thu, 09 Feb 2006 17:22:46 -0700
From: Jeff Custard
To: Pete Siemsen
Subject: [firefox extension sound fix]Re: [FTC] Nagios question
Pete:
Here's the solution I'm going to use (for now anyway) in Firefox (a nifty extension I found today):
https://addons.mozilla.org/extensions/moreinfo.php?application=firefox&id=1765Some quick research this afternoon would have me believe this issue will be more widely addressed (like the built in Opera option now) in the very near future.
Some of the links I found this afternoon while looking into this a bit more:
I struggled mightily to get Safari to play Nagios sounds, to no avail. I finally decided to run Nagios under Firefox on ibex, a Linux system in my office.
Here's an email I sent to the Nagios list, a QuickTime list and macosxhints, with no replies.This problem is a Mac OS X problem, or a Safari problem, or a QuickTime problem, or a Nagios problem - I'm not sure.
I can't get Nagios noises to come out of my Safari browser. Other Nagios users at my company have no problems getting noises out of, say, Firefox on Linux. I can't get them out of Safari on my Mac. But I'm on the trail...
I'm the admin for Nagios at my site, where I run Nagios 2.6 on a Linux box. On my client Mac, I'm running Safari 2.0.4 (419.3) under Mac OS X 10.4.10. When I visited our local Nagios server with Safari, everything looked fine and I could navigate fine. But when Nagios tried to make a sound, I got a dialog box that said
Safari can't display content on this page.
The application "Windows Media Player.app" may be able to play this content. Would you like to try?
When I clicked "No", of course the Safari dialog disappeared quietly. When I clicked "Ok", WMP fired up and immediately popped up its own dialog box that said "One or more arguments are not valid". So WMP can't handle it. Safari's dialog served as a visible indicator that Nagios was unhappy, but I'd much rather have an audible indicator, and not have to get rid of the dialog every time :-)
Safari can play the raw Nagios sounds. If I navigate to my Nagios server and go directly to the sound file at http://nagman.scd.ucar.edu/nagios/media/hostdown.wav, Safari uses QuickTime to play the Nagios "hostdown" sound just fine.
I used Wireshark to capture the packets sent by the Nagios server to my Nagios client. I learned that when Nagios wants to make a sound, it embeds this in the HTML:
<object type="application/x-mplayer2" height="-" width="0">
<paramname="filename" value="/nagios2/media/hostdown.wav">
<param name="autostart" value="1">
<param name="playcount" value="1">
</object>You can see the same text using Safari's "View->View Source". (?) Remember that the HTML fragment only appears when the page contains a sound. In Nagios, having a bunch of red acknowledged stuff on a page isn't enough there has to be at least one unacknowledged red item on the page. It was essential that I view the source immediately after Safari failed to play a sound.
It looked like a MIME problem, so I used the Mac third-party application named "Default Apps" (a.k.a. RCDefaultApp) to set my Mac to use Quicken to play the "application/x-mplayer2" MIME type. After that, when Nagios tried to make a sound, Safari displayed
Safari cannot find the Internet plug-in.
The page "Nagios" has a content of MIME type "application/x-mplayer2". Because you don't have a plug-in installed for this MIME type, this content can't be displayed.
Hmmm. It changed things, but just to a different error.
Safari has a "Help->Installed Plug-ins" menu item. It listed "QuickTime Plug-in 7.2", with a long list of MIME types that QuickTime will handle. But the MIME types listed for QuickTime 7.2 didn't include "application/x-mplayer2". "System Preferences" has a QuickTime section with an "Advanced" tab that has a "MIME Settings..." button, but that sets the MIME types that QuickTime handles, not the MIME types of the QuickTime plugin handles. Anyway, there doesn't seem to be one that deals with "application/mplayer2".
I went to the Quicktime website at http://www.apple.com/quicktime/download/, and found a manual for QuickTime. It didn't help. The site has pointers to mailing lists, but I got no responses there.
Nagios generates the HTML pages from /usr/lib/cgi-bin/nagios2/status.cgi. If I can't fix it any other way, I suppose I could modify Nagios to make it send something other than "application/x-mplayer2". The CGIs are binaries, so this would take a litte bit of work. At least if I did this I could contribute the solution back into the Nagios sources. The MIME type really shouldn't be "application/x-mplayer2".
Help!
-- Pete
I tried editing the /usr/lib/cgi-bin/nagios2/status.cgi binary to change "application/x-mplayer2" to "audio/wav" with spaces after the quote to fill out the string to the same size. This caused no noise at all to come out of Safari or other browsers. When I changed it to "audio/x-wav", it worked for operations but still didn't work in Safari.
I tried downloading and installing Flip4Mac WMV. This installed a new Safari plug-in that lists "application/x-mplayer2" as a supported MIME type. When Nagios tried to make a noise, Safari no longer displayed the dialog box, but it didn't make a sound either. I posted to the Flip4Mac forum.
I tried switching to Firefox on the Mac, but it also doesn't produce sounds.
TBD.
Opera: lets you turn sound on and off. Go to Tools->Preferences. Click the Advanced tab. Select the Notifications entry. Uncheck the Enable program sounds box.