Nagios 3.03 sounds the horn even when no alerts


I finally got the sounds going by editing cgi/tac.c and cgi/status.c in the source folder and changing “application/wav” to “audio/wav”, Then I did a ./configure, make cgi, then copied the new tac.cgi and status.cgi files to /usr/local/nagios/sbin. Yaay.

Then I tested it on my status page - Aoooga! cool, it works. Then I acknowledged all errors to clear them all - and still Aooga! I keep getting alerts even though everything is acknowledged and I have “0 matching service entries Displayed”.

what gives? any ideas on how to make the sound only come when there’s an alert on the status.cgi page?




:frowning: It must track by the “Status Totals” counts (top right) - in there, 1 critical Service/Host is still 1 critical Service/Host regardless of whether it is ack’d or not… less than useful, that… I guess a way around it would be to write a wrapper script that for the ‘Unhandled’ views of status.cgi that just spits out HTML as-is, except will suppress the AOOGA! if it sees a string match with “0 matching service entries Displayed”, but as solutions go, it isn’t the most elegant…


Thanks. You hit the nail on the head there. The problem was that our helpdesk didn’t want to acknowledge every service that was down when a host went down. Some of our servers have 10 services being monitored on them, so it would be a pain. So I filtered that out on the page the helpdesk has on the big monitor, but the horn sounds until everything is cleared.

So I did what you suggested. I just added the following to status.c in the part enclosed by /*added by adam */ between the printf and return

            printf("<BR><DIV CLASS='itemTotalsTitle'>%d Matching Service Entries Displayed</DIV>\n",total_entries);

/* added by adam /
printf("<object type=“audio/wav” data="/nagios/media/critical.wav" height=“0” width=“0”>");
printf("<param name=“filename” value="/nagios/media/critical.wav">");
printf("<param name=“autostart” value=“1”>");
printf("<param name=“playcount” value=“1”>");
done added by adam */

Then I took out the sound definitions in the cgi.cfg. Now whenever they view a page and it says “0 matching service entries Displayed” they get no sound, but if the number isn’t 0 then they get a sound. This sucks for browsing nagios, but works for the helpdesk. For now, the helpdesk uses IE (get sound) and everyone else uses firefox (no sound)