From RootdevWiki

Jump to: navigation, search

Because the doco for this is patchy at best, this is a scratch pad for issues, tips and tricks in installing and configuring OpenNMS. This is a very powerful and flexible Network Monitoring System, but actually getting it to do anything useful can be quite daunting.


Contents

OpenNMS Installation and Config Notes

The notes here refer to version 1.5.90 running the embedded Jetty webapps.

If you hit an obstacle, check the mailing list archives either here:

http://marc.theaimsgroup.com/?l=opennms-discuss&r=1&w=2

or here:

http://dir.gmane.org/gmane.network.opennms.general

You will probably find an answer to most questions here if you can work out the right question to ask ;-)

Config Tips

Disable Login Timeout

NB - This problem does not seem to apply to 1.2.x and seems to have been introduced in the 1.3.x series, although if you leave the interface open on a page with a suitable refresh header allegedly this does not affect you.

Edit $OPENNMS_HOME/jetty-webapps/opennms/WEB-INF/web.xml

  <!-- Uncomment this to set the webapp timeout to infinite.
  <session-config>
    <session-timeout>-1</session-timeout>
  </session-config>
  -->

Change Page Refresh on individual pages

Again, see $OPENNMS_HOME/jetty-webapps/WEB-INF/web.xml

For example to change the page refresh rate to 30 seconds on the alarms page, look for the <filter-mapping> section and add a snippet like the following:

  <filter-mapping>
    <filter-name>AddRefreshHeader-30</filter-name>
    <url-pattern>/event/list</url-pattern>
  </filter-mapping>

NB: the RefreshHeader filters are set elsewhere in the file to either 300, 120 or 30 seconds. If you want to change these defaults just add another RefreshHeader snippet, for instance, to add a 60 second refresh:

  <filter>
    <description>
         Adds the refresh HTTP header to a servlet's or JSP's output 
         so it will be automatically reloaded.
    </description>
    <filter-name>AddRefreshHeader-300</filter-name>
    <filter-class>org.opennms.web.AddRefreshHeaderFilter</filter-class>
    <init-param>
      <description>
           This parameter specifies how often to refresh the page.
      </description>
      <param-name>seconds</param-name>
      <param-value>300</param-value>
    </init-param>
  </filter>

Events, Alarms and Notifications

By default, OpenNMS does not create any alarms or send out any notifications, and since this is the primary reason for installing an NMS in the first place it is worth reading up on this as it can be quite time consuming to set up.

Read this first, then come back:

http://www.opennms.org/index.php/Event_Configuration_How-To

Ok, some tips (which were also indicated in the page you just read so you already know this, right? ;-) )

Managing the events files

  • Edit $OPENNMS_HOME/etc/eventconf.xml and comment out any <event-file> entries you know you don't require.
  • If you need to edit any of the remaining events files, copy the file to my.[vendor].events.xml and link to this file from $OPENNMS_HOME/etc/eventconf.xml. This will save you time and effort if the original file changes in a later upgrade.

Notifications

When it comes to sending out email alerts the OpenNMS JavaMail interface is now the default. Which is all well and good, except that by default it is also disabled in the javamail-configuration.properties file. You will need to edit this file to configure it to send mail. You will probably want to leave the JMTA disabled and use your standard MTA for the time being.

Event notifications can seem extremely obtuse to configure. Perhaps the best way to start with might be to generate some actual events, then click on the Edit notifications for this event link in the event list.

Alternatively, the notifications are contained in notifications.xml. You will probably find it more intuitive, and a lot quicker, to edit this file rather than try to set up notifications for each individual event via the GUI. For example, the following two snippets configure the alerts for MySQL and Apache:

    <notification name="MySQL Service Down" status="on" writeable="yes">
        <uei xmlns="">uei.opennms.org/nodes/nodeLostService</uei>
        <description xmlns="">MySQL Service Down on host</description>
        <rule xmlns="">(IPADDR != '0.0.0.0') &  (isMySQL )</rule>
        <destinationPath xmlns="">email-dbas</destinationPath>
        <text-message xmlns="">
          %service% on %nodelabel%, %interface% is not responding
        </text-message>
        <subject xmlns="">%service% on %nodelabel% DOWN</subject>
        <numeric-message xmlns="">111-%noticeid%</numeric-message>
    </notification>
    <notification name="HTTP Service Down" status="on" writeable="yes">
        <uei xmlns="">uei.opennms.org/nodes/nodeLostService</uei>
        <description xmlns="">MySQL Service Down on host</description>
        <rule xmlns="">
(IPADDR != '0.0.0.0') & (isHTTP | isHTTP-8080 | isHTTP-8000 | isHTTPS )
        </rule>
        <destinationPath xmlns="">email-unix-admins</destinationPath>
        <text-message xmlns="">
          %service% on %nodelabel%, %interface% is not responding
        </text-message>
        <subject xmlns="">
          %service% on %nodelabel% Lost Service
        </subject>
        <numeric-message xmlns="">111-%noticeid%</numeric-message>
    </notification>

You will notice the <destinationPath xmlns=""> tag. These paths need to be configured either via the GUI or in the destinationPaths.xml file.

Dashboards and Surveillance Views

Read this: http://www.opennms.org/index.php/Dashboard

The Surveillance Views and the Dashboard provide a great deal of flexibility to assign users or groups different default views into the systems being monitored. The above page should explain almost everything you need to know to work with these features.

Setting Surveillance Categories

The dashboard view is based on the surveillance views and surveillance categories.

The important point to remember is that your nodes must be added to surveillance categories or else they won't show up in the surveillance views, and hence will not be present in the dashboard.

You can add a node to a category by clicking on it in the node list and clicking Edit in the Surveillance Category Memberships box, but you will want more than just the default categories, and if you have hundreds of nodes this is an unnecessarily time consuming way to manage it.

It's quicker to go to the admin section and Manage Surveillance Categories. Here you can add whatever new categories you require, and by editing a category name you can add or remove target nodes on mass via the select boxes.

Any new categories you add here can now be added to the Surveillance Views file to define either individual or group views. Edit surveillance-views.xml and add a snippet like the following to give your non-unix admins a view of the Windows/Netware/etc systems:

    <view name="WindowsAdmins" refresh-seconds="300" >
      <rows>
        <row-def row="1" label="Non-Unix Servers" >
          <category name="Non-Unix" />
        </row-def>
        <row-def row="2" label="Netware" >
          <category name="Netware" />
        </row-def>
        <row-def row="3" label="Windows" >
          <category name="Windows" />
        </row-def>
      </rows>
      <columns>
        <column-def col="1" label="PROD" >
          <category name="Production" />
      </column-def>
        <column-def col="2" label="TEST" >
          <category name="Test" />
        </column-def>
        <column-def col="3" label="DEV" >
          <category name="Development" />
        </column-def>
      </columns>
    </view>

You will recall from the online doco that surveillance views operate on a first-match basis:

  1. Surveillance View name equal to the user name they used when logging into OpenNMS.
  2. Surveillance View name equal to the user's assigned OpenNMS group name
  3. Surveillance View name equal to the 'default-view' attribute in the surveillance-views.xml configuration file.

So the <view name="WindowsAdmins">tag here matches the group name to which you have assigned your Windows admins.

Hopefully that should give you a brief idea of what you can do with this feature.