Add sound to the webUI
Subscribe

From OpenNMS

Jump to: navigation, search

Add Sound / Flashing Background to the OpenNMS Main Page

See http://bugzilla.opennms.org/show_bug.cgi?id=3062, Version unknown, probably 1.6.x and later

Add Sound to the servicesdown-box

Using OpenNMS 1.5.93:

In OPENNMS_HOME/jetty-webapps/opennms/includes/servicesdown-box.jsp (or OPENNMS_HOME/webapps/opennms/includes/servicesdown-box.jsp if using Tomcat instead of Jetty):

    <c:otherwise>
      <embed src="tngchime.wav" type="audio/x-pn-realaudio-plugin" hidden="true" autostart="true" loop="false" height="0" width="0">
      <ul class="plain">
        <c:forEach var="summary" items="${summaries}">
          <c:url var="nodeLink" value="element/node.jsp">
            <c:param name="node" value="${summary.nodeId}"/>
          </c:url>
          <li><a href="${nodeLink}">${summary.nodeLabel}</a> (${summary.fuzzyTimeDown})</li>
        </c:forEach>
      </ul>

      <c:if test="${moreCount > 0}">
        <p class="noBottomMargin" align="right">
          <c:url var="moreLink" value="outage/current.jsp"/>
          <a href="${moreLink}">${moreCount} more...</a>
        </p>
      </c:if>
    </c:otherwise>

The line with the <embed> tag is new, the rest is stock. This causes a sound (tngchime.wav, which must be present inside the OpenNMS web app directory) be played any time this box loads if there is at least one current outage.

Works in Firefox 1.+and IE6. Needs RealPlayer for Linux (on the client browser, not on the OpenNMS server) but M$ seems to handle it without.