Can't hear sounds because Nagios uses application/x-mplayer2

Pete Siemsen siemsen at ucar.edu
Fri Sep 21 17:54:21 CEST 2007


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 close!

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 visit our local Nagios server with Safari, everything looks  
fine and
I can 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 "Ok", WMP fired up and immediately popped up its own  
dialog box
that said "One or more arguments are not valid".  When I clicked  
"No", of course
the Safari dialog disappeared quietly.  So the Safari dialog was 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 is capable of playing Nagios noises.  If I navigate to my  
Nagios server
and go to /media/hostdown.wav, Safari uses QuickTime to play the Nagios
"hostdown" sound just fine.

I suspected a MIME type problem, so I set my Mac to use QuickTime
to play audio/x-wav things.  This didn't change the behavior.

Then I used Wireshark to capture the packets sent by our Nagios
server to my Mac.  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>

I later discovered that I could see the same text using Safari's
"View->View Source", *but only if the page was one that had a  
sound*.  In
other words, a bunch of red acknowledged stuff 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,
and before the web page auto-updated.

So I used "Default Apps" (a.k.a. RCDefaultApp) to set my Mac to play
the "application/x-mplayer2" MIME type with QuickTime.  This time  
around,
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.  I changed things, but just ta a different error.

Then I discovered that Safari has a "Help->Installed Plug-ins".  It  
listed
"QuickTime Plug-in 7.2", with a long list of MIME types that  
QuickTime will
handle.  Actually, it listed QuickTime twice.  I deleted a file from
/Library/Internet Plug-Ins and and restarted Safari to get that down  
to one.
But the MIME types listed for QuickTime 7.2 didn't include
"application/x-mplayer2".  Sigh.

Then I discovered that System Preferences has a QuickTime section.   
It has
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".

Then I discovored that there's support at http://www.apple.com/ 
quicktime/download/,
including a manual for QuickTime, mailing lists, etc.

Then I discovered that it's the /usr/lib/cgi-bin/nagios2/status.cgi
that generates the responses.  Perhaps if I could modify it to use
something other than "application/x-mplayer2"?  Nagios is open source,
right?

Do I actually have to modify Nagios souurce code to fix this?

Help!

-- Pete




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20070921/67ef1e54/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
-------------- next part --------------
_______________________________________________
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