Tutorial Polling
Subscribe

From OpenNMS

Jump to: navigation, search

This part of the tutorial assumes that you have already done theCapabilities Scanning Tutorial.

In this tutorial, when you see "$OPENNMS_HOME," that refers to the root directory of your OpenNMS installation, usually "/opt/opennms" on RPM-based systems, "/var/lib/opennms" on Debian-based systems, or "C:\Program Files\OpenNMS" on Windows.

Contents

Service Polling

Service polling is an integral part of OpenNMS. It is one of the main ways that OpenNMS gathers data about the network. The daemon responsible for handling all polling is Pollerd, it is responsible for monitoring a service and reporting on its responsiveness. For each service there are service monitors that can be configured in the 'poller-configuration.xml in $OPENNMS_HOME/etc directory.

Pollerd is highly customizable, the poller-configuration.xml file contains poller configuration. In this tutorial we'll walk you through configuring your own monitor to test the OpenNMS GUI.

Monitors

Service Monitors are the actual workers behind Pollerd, they are carry out the service poll are report back to Pollerd the response time. Each monitor has a particular service type that it can monitor. There is an Http Monitor for monitor web sites, there is an FTP Monitor for FTP, SSH, DHCP, IMAP and many more.

Outages

An outage will be recorded for a service on an interface when it fails to successfully poll that service.

Polling Services on Devices

Polling a service on a device is a two part job, first that service must be scanned initially, which you read about in the Capabilities Tutorial then a matching poller that has the same service name must be present in the poller-configuration.xml file.

To keep this tutorial short I will not discuss everything there is in the poller-configuration.xml file, if you want to read about each element in the config you can find that information here.

Adding a Custom Monitor

To add a custom poller monitor for Pollerd, edit the poller-configuration.xml file in $OPENNMS_HOME/etc. All Pollerd monitors take the port, timeout, retry, rrd-repository, rrd-base-name and ds-name, but many can take additional parameters as well which allow you to tune particular monitor behaviors.

Note.png Try It! Adding the OpenNMS Web Server

As an example, let's build on our previous OpenNMS Web Server example from the Capabilities Tutorial where we added a custom HttpPlugin configuration to detect the OpenNMS Web Server. In this example we will add a service monitor for the OpenNMS WebUI. Edit poller-configuration.xml and add the following lines between the ending rrd tag and the first service tag within the example1 package.

   <service name="OpenNMS-WebUI" interval="300000" user-defined="false" 
        status="on">
      <parameter key="retry" value="1" />
      <parameter key="timeout" value="3000" />
      <parameter key="port" value="8980" />
      <parameter key="url" value="/" />
      <parameter key="rrd-repository" 
        value="$OPENNMS_HOME/share/rrd/response" />
      <parameter key="rrd-base-name" value="opennms-webui" />
      <parameter key="ds-name" value="opennms-webui" />
    </service>
    • For the rrd-repository parameter change the $OPENNMS_HOME value to you own path to your opennms home directory.

Then, restart OpenNMS to take the new config:

  $OPENNMS_HOME/bin/opennms restart

Now go to the node page that has the OpenNMS-WebUI service and you will notice that it is now being monitored.