Introduction to OpenNMS

113
Introduction to OpenNMS POSSCON – 15 April 2015 Tarus Balog [email protected]

Transcript of Introduction to OpenNMS

Introduction to OpenNMS

POSSCON – 15 April 2015

Tarus Balog [email protected]

Agenda for Workshop

• What the heck is OpenNMS?

• Getting It Installed

• The Net-SNMP Agent

• Provisioning and Discovery

• Event Management

• Notifications

• Service Assurance

• Data Collection

OpenNMS is the world's first enterprise-grade network management application platform developed under the open source model.

“world's first”

• NetSaint 2000-01-10 1323

• OpenNMS 2000-03-30 4141

• Nagios 2001-05-03 26589

• RRDTool 2003-01-13 71544

• Groundwork 2006-02-21 160654

• ZeNOss 2006-03-20 163126

• Hyperic 2006-07-17 172556

“enterprise-grade”

• Nearly 60,000 Devices on a Single Instance (Swisscom)

• 1.2 Million Data Points Every Five Minutes (New Edge)

• 120,000 syslog message per minute (SRNS)

• 32,000 Interfaces per Device (Wind)• 3000 Remote Monitors (Papa Johns)

“network management application platform”

The Architecture of OpenNMS has been designed to allow for easy integration of other tools, both proprietary and open.

“open source model”

OpenNMS is published under the AGPLv3 and all components are

licensed under an OSI-qualified free software license.

• Provisioning: Both Automated Discovery and Directed Discovery.

• Event and Notification Management: Generate, receive, reduce and correlate various network alerts and feed them to a robust notification system.

• Service Assurance: Is a particular network service reachable and available?

• Performance Data Collection: Gather numeric data from across the network for display, trending and thresholding.

The Four Main Areas of OpenNMS

The Architecture

Network

PostgreSQL

RRD

RRD

RRD

RRD

RRD

Jetty/Tomcat

poller

JDB

C

LD

AP

DN

S

HT

TP

SM

TP

IMA

P

PO

P3

TC

P

ICM

P

Discoverycapsd/

provisiond(Capabilities

Daemon)ICMPD

EVENTD (Event Daemon)

trapd(SNMP Trap

Receiver)

RTC ViewCategory Manager

Users

threshd

collectdSNMPHTTP

OpenNMS Versions

Let's Get This Sucker Installed

• Java JDK (7 or higher)• PostgreSQL• jicmp• opennms-core• Opennms-jetty-webapp• iplike• jrrd (optional)

OpenNMS Packages in Debian$ sudo apt­get install opennmsReading package lists... DoneBuilding dependency tree       Reading state information... DoneThe following extra packages will be installed:  heirloom­mailx iplike­pgsql93 jicmp jicmp6 libdbd­pg­perl libdbi­perl  libgetopt­mixed­perl libopennms­java libopennmsdeps­java libpq5  opennms­common opennms­db opennms­server opennms­webapp­jetty postgresql­9.3  postgresql­client­9.3 postgresql­client­common postgresql­commonSuggested packages:  exim4 mail­transport­agent libmldbm­perl libnet­daemon­perl libplrpc­perl  libsql­statement­perl opennms­doc jrrd rrdtool oidentd ident­server  locales­all postgresql­doc­9.3Recommended packages:  libnet­snmp­perl libxml2­utils libwww­perl libxml­twig­perlThe following NEW packages will be installed:  heirloom­mailx iplike­pgsql93 jicmp jicmp6 libdbd­pg­perl libdbi­perl  libgetopt­mixed­perl libopennms­java libopennmsdeps­java libpq5 opennms  opennms­common opennms­db opennms­server opennms­webapp­jetty postgresql­9.3  postgresql­client­9.3 postgresql­client­common postgresql­common0 upgraded, 19 newly installed, 0 to remove and 7 not upgraded.Need to get 507 MB of archives.After this operation, 657 MB of additional disk space will be used.Do you want to continue? [Y/n] 

Packages Are Your Friend

• Use “yum” on rpm-based distros• Use “apt” on Debian/Ubuntu distros• Use Solaris packages for Sun• Use the standalone installer for Windows• Use the wiki for FreeBSD

Getting Set Up

• The java to use must be set:

$OPENNMS_HOME/bin/runjava ­s

• The installer should be run:

$OPENMS_HOME/bin/install ­dis

• The iplike function should be installed.

Start 'er Up

• Make sure the database is running and is accessible on localhost:5432

• Start the Application:

$OPENNMS_HOME/bin/opennms start

• Access the WebUI:

http://[host]:8980/opennms

Where OpenNMS Stores Data

• Database (PostgreSQL)• Round Robin Database (JRobin or

RRDtool) (/opt/opennms/share/rrd)

• Configuration:

/opt/opennms/etc (for RPMs)

/etc/opennms (for debs)

XML or .properties files

javamail.propertiesorg.opennms.core.utils.fromAddress=ouce.tarus@gmail.com

# These properties define the SMTP Host.#org.opennms.core.utils.mailHost=127.0.0.1org.opennms.core.utils.mailHost=smtp.gmail.com#org.opennms.core.utils.mailer=smtpsend#org.opennms.core.utils.transport=smtporg.opennms.core.utils.transport=smtps#org.opennms.core.utils.debug=true#org.opennms.core.utils.smtpport=25org.opennms.core.utils.smtpport=465#org.opennms.core.utils.smtpssl.enable=falseorg.opennms.core.utils.smtpssl.enable=true#org.opennms.core.utils.quitwait=true

# These properties define the Mail authentication.#org.opennms.core.utils.authenticate=falseorg.opennms.core.utils.authenticate=true#org.opennms.core.utils.authenticateUser="opennms"[email protected]#org.opennms.core.utils.authenticatePassword=passwordorg.opennms.core.utils.starttls.enable=falseorg.opennms.core.utils.starttls.enable=true

# These properties configure message content#org.opennms.core.utils.messageContentType=text/plainorg.opennms.core.utils.messageContentType=text/html#org.opennms.core.utils.charset=us­asciiorg.opennms.core.utils.charset=UTF­8

Users, Groups and Roles

Add a Username and Password

Add User Information

Be Sure to Press “Finish”

New User Should Be Listed

Edit magic-users.properties

############################################################################# R O L E S     ###########################################################################

# A comma­separated list of role keys.  A role.{KEY}.name and # role.{KEY}.users property must be set for each key in this property.roles=rtc, admin, rouser, dashboard, provision, remoting, rest

# This role allows a user to make RTC data posts.role.rtc.name=OpenNMS RTC Daemonrole.rtc.users=rtcrole.rtc.notInDefaultGroup=true

# This role allows users access to configuration and # administrative web pages.role.admin.name=OpenNMS Administratorrole.admin.users=admin,tarus

Login as New User

The Net-SNMP Agent

• Net-SNMP is an open source SNMP agent originally build at the University of California – Davis campus

• Can be used to send events to OpenNMS

• Can be used by OpenNMS to test processes or collect data

/etc/snmp/snmpd.conf(change listen address)

#################################################################################  AGENT BEHAVIOUR#

#  Listen for connections from the local system only# agentAddress  udp:127.0.0.1:161#  Listen for connections on all interfaces (both IPv4 *and* IPv6)agentAddress udp:161,udp6:[::1]:161

/etc/snmp/snmpd.conf (change access control)

#################################################################################  ACCESS CONTROL#

                                                 #  system + hrSystem groups only# view   systemonly  included   .1.3.6.1.2.1.1# view   systemonly  included   .1.3.6.1.2.1.25.1view   systemonly  included   .1

/etc/snmp/snmpd.conf (change contact information)

#################################################################################  SYSTEM INFORMATION#

#  Note that setting these values here, results in the corresponding MIB objects being 'read­only'#  See snmpd.conf(5) for more details

sysLocation    IT­ology, 1301 Gervais St Suite 200, Columbia, SC 29201,               USA, North America, EarthsysContact     Tarus Balog <[email protected]>

/etc/snmp/snmpd.conf (enable non-free, install MIBs)

# vi /etc/apt/sources.list

deb http://ftp.utexas.edu/debian/ squeeze main non­freedeb­src http://ftp.utexas.edu/debian/ squeeze main non­free

# apt­get update

# apt­get install snmp­mibs­downloaderReading package lists... DoneBuilding dependency tree       Reading state information... DoneThe following extra packages will be installed:  smistripSuggested packages:  unzipThe following NEW packages will be installed:  smistrip snmp­mibs­downloader0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.Need to get 5,147 kB of archives.After this operation, 5,964 kB of additional disk space will be used.Do you want to continue [Y/n]? 

/etc/snmp/snmp.conf

## As the snmp packages come without MIB files due to license reasons, loading# of MIBs is disabled by default. If you added the MIBs you can reenable# loaging them by commenting out the following line.# mibs :

Restart snmpd and Test

# invoke­rc.d snmpd restartRestarting network management services: snmpd.

# snmpwalk ­v2c ­c public localhost ipaddrtableIP­MIB::ipAdEntAddr.127.0.0.1 = IpAddress: 127.0.0.1IP­MIB::ipAdEntAddr.192.168.54.134 = IpAddress: 192.168.54.134IP­MIB::ipAdEntIfIndex.127.0.0.1 = INTEGER: 1IP­MIB::ipAdEntIfIndex.192.168.54.134 = INTEGER: 2IP­MIB::ipAdEntNetMask.127.0.0.1 = IpAddress: 255.0.0.0IP­MIB::ipAdEntNetMask.192.168.54.134 = IpAddress: 255.255.255.0IP­MIB::ipAdEntBcastAddr.127.0.0.1 = INTEGER: 0IP­MIB::ipAdEntBcastAddr.192.168.54.134 = INTEGER: 1

See coldstart Events in OpenNMS

provisiond

• Controls both automated and directed discovery

• The “foreign source” controls what gets discovered

• The “foreignid” is a unique key for the device

• Can finely control what gets discovered• Everything reflected in XML files

Create a Provisiong Group

Create a Requisition

Add a localhost Device

Synchronize the Group

Reflected in XML

<?xml version="1.0" encoding="UTF­8" standalone="yes"?><model­import last­import="2011­05­25T10:02:56.362­04:00"               foreign­source="OUCE2011"               date­stamp="2011­05­25T10:02:55.972­04:00"               xmlns="http://xmlns.opennms.org/xsd/config/model­import">    <node node­label="localhost" foreign­id="1306331138779" building="OUCE2011">        <interface status="1" snmp­primary="P" ip­addr="127.0.0.1" descr="lo">            <monitored­service service­name="SNMP"/>            <monitored­service service­name="ICMP"/>        </interface>    </node></model­import>

Enabled via ReST

Configure Automatic Discovery

<discovery­configuration    threads="1"    packets­per­second="1"     initial­sleep­time="30000"    restart­sleep­time="86400000"     retries="1"     timeout="2000">    <include­range retries="1" timeout="2000">        <begin xmlns="">10.1.0.1</begin>        <end xmlns="">10.1.0.254</end>    </include­range></discovery­configuration>

A Requisition for a Virtual Node

Import Asset Information

Set Up Provisioning Policies

Additional Provisioning Adapters

# apt­cache search provisioning

opennms­plugin­provisioning­map   ­ Enterprise­grade Open­source Network Management Platform     (Map Provisioning Adapter)opennms­plugin­provisioning­rancid   ­ Enterprise­grade Open­source Network Management Platform     (RANCID Provisioning Adapter)opennms­plugin­provisioning­dns   ­ Enterprise­grade Open­source Network Management Platform     (DNS Provisioning Adapter)opennms­plugin­provisioning­link   ­ Enterprise­grade Open­source Network Management Platform     (Link Provisioning Adapter)opennms­plugin­provisioning­snmp­asset   ­ Enterprise­grade Open­source Network Management Platform     (SNMP Asset Provisioning Adapter)

Events

• OpenNMS can generate internal events, receive external events such as SNMP traps

• Events can be reduced – taking a number of events and representing them as a single line with a count

• Events can be translated into other events• Events can be turned into alarms for

correlation.

Event reduction

Automations

Automations

Automations

Create Custom Events

• OpenNMS listens on port 5817 for event messages

• Events are simply properly formatted XML objects

• Use or modify the included send­event.pl script for creating events

Unique Event Identifier

• A new interface is discovered: uei.opennms.org/internal/discovery/newSuspect

• A service is down:uei.opennms.org/nodes/nodeLostService

• All services on an interface are down:uei.opennms.org/nodes/interfaceDown

• All interfaces on a node are down:uei.opennms.org/nodes/nodeDown

Create Custom UEIs

$ /usr/share/opennms/bin/send­event.pl uei.ouce/demo/testEvent

Create Custom UEIs

$ send­event.pl –severity 7 uei.ouce/demo/testEvent

$ cat OUCE.events.xml 

<events><event> <uei>uei.ouce/demo/testEvent</uei> <event­label>An Event Created for the OUCE</event­label> <descr>&lt;p&gt;         This event is just to demonstrate custom events in OpenNMS.        &lt;/p&gt; </descr> <logmsg dest='logndisplay'>        &lt;p&gt;         Guten Abend folks at OUCE.        &lt;/p&gt; </logmsg> <severity>Warning</severity> <alarm­data reduction­key="%uei%" alarm­type="3" auto­clean=”false"/></event></events>

Configure the UEI

$ tail eventconf.xml 

  <event­file>events/VMWare.events.xml</event­file>  <event­file>events/Waverider.3000.events.xml</event­file>  <event­file>events/Xerox­V2.events.xml</event­file>  <event­file>events/Xerox.events.xml</event­file>  <event­file>events/OUCE.events.xml</event­file>

  <event­file>events/Standard.events.xml</event­file>  <event­file>events/Translator.default.events.xml</event­file>  <event­file>events/default.events.xml</event­file>

Configure the UEI

View Formatted Event

View Formatted Alarm

Notifications

• Any command line application can be used to send notices:– Email– Pages– SMS messages– IM's via XMPP (Jabber)

• Includes– Duty schedules and roles– Escalations– Auto acknowledgment

Destination Paths

Create a New Path

Add Targets

Chose A Method (one or more)

Create a New Notice

Define the Notice

Make Sure It Is On

Start/Stop Notices Globally

Run a Test

• Send the OUCE event from earlier:/usr/share/opennms/bin/send­event.pl uei.ouce/demo/testEvent

• Verify it shows up

Service Assurance

• Monitor network services like HTTP, DNS, Databases and even ICMP

• Calculate availability over devices and categories.

• Packages and adaptable downtime models• Support for plugins, including Nagios® and

custom scripts• Distributed monitoring via webstart app

Adaptable Downtime Model

• When an outage occurs, OpenNMS changes the default service poll:– 30 second polls for the first 5 minutes– 5 minute polls for the first 12 hours– 10 minute polls for the first 5 days– Unmange the service if down longer

• Shortest outage is on the order of 30 seconds

Using Net-SNMP for SA

• Protocols like SSH don't scale and have security issues

• Net-SNMP can be easily extended and secured

• Use the “extend” feature with OpenNMS for easy custom poller creation

Create a Simple Script

# cat /tmp/ouce­process.sh #!/bin/bashecho ok

# chmod +x /tmp/ouce­process.sh 

# /tmp/ouce­process.sh ok

Edit /etc/snmp/snmpd.conf

############################################################# EXTENDING THE AGENT#

## Arbitrary extension commands# extend test1 /bin/echo Hello, world! extend-sh test2 echo Hello, world! ; echo Hi there ; exit 35

extend ouce /tmp/ouce-process.sh

# invoke-rc.d snmpd restartReloading network management services: snmpd.

# snmpwalk ­v1 ­c public localhost .1.3.6.1.4.1.8072.1.3.2NET­SNMP­EXTEND­MIB::nsExtendNumEntries.0 = INTEGER: 1NET­SNMP­EXTEND­MIB::nsExtendCommand."ouce" = STRING: /tmp/ouce­process.shNET­SNMP­EXTEND­MIB::nsExtendArgs."ouce" = STRING: NET­SNMP­EXTEND­MIB::nsExtendInput."ouce" = STRING: NET­SNMP­EXTEND­MIB::nsExtendCacheTime."ouce" = INTEGER: 5NET­SNMP­EXTEND­MIB::nsExtendExecType."ouce" = INTEGER: exec(1)NET­SNMP­EXTEND­MIB::nsExtendRunType."ouce" = INTEGER: run­on­read(1)NET­SNMP­EXTEND­MIB::nsExtendStorage."ouce" = INTEGER: permanent(4)NET­SNMP­EXTEND­MIB::nsExtendStatus."ouce" = INTEGER: active(1)NET­SNMP­EXTEND­MIB::nsExtendOutput1Line."ouce" = STRING: okNET­SNMP­EXTEND­MIB::nsExtendOutputFull."ouce" = STRING: okNET­SNMP­EXTEND­MIB::nsExtendOutNumLines."ouce" = INTEGER: 1NET­SNMP­EXTEND­MIB::nsExtendResult."ouce" = INTEGER: 0NET­SNMP­EXTEND­MIB::nsExtendOutLine."ouce".1 = STRING: ok

.1.3.6.1.4.1.8072.1.3.2.4.1.2.4.111.117.99.101.1 = STRING: ok

MIB Output with extend

Edit Foreign Source for Service

KEY = .1.3.6.1.4.1.8072.1.3.2.4.1.2.4.111.117.99.101.1

Create Polling Package  <package name="OUCE Example">    <filter>IPADDR != '0.0.0.0'</filter>    <include­range begin="1.1.1.1" end="255.255.255.255" />    <rrd step="30">      <rra>RRA:AVERAGE:0.5:1:20160</rra>      <rra>RRA:AVERAGE:0.5:12:1488</rra>      <rra>RRA:AVERAGE:0.5:288:366</rra>      <rra>RRA:MAX:0.5:288:366</rra>      <rra>RRA:MIN:0.5:288:366</rra>    </rrd>    <service name="OuceProcess" interval="30000" user­defined="true" status="on">      <parameter key="retry" value="1" />      <parameter key="timeout" value="5000" />      <parameter key="port" value="161" />      <parameter key="oid" value=".1.3.6.1.4.1.8072.1.3.2.4.1.2.4.111.117.99.101.1 " />      <parameter key="operator" value="=" />      <parameter key="operand" value="ok" />    </service>    <downtime interval="30000" begin="0" end="300000" /><!­­ 30s, 0, 5m ­­>    <downtime interval="300000" begin="300000" end="43200000" /><!­­ 5m, 5m, 12h ­­>    <downtime interval="600000" begin="43200000" end="432000000" /><!­­ 10m, 12h, 5d ­­>    <downtime begin="432000000" delete="true" /><!­­ anything after 5 days delete ­­>  </package>

Add Monitor at the Bottom

  <monitor service="Windows­Task­Scheduler"     class­name="org.opennms.netmgt.poller.monitors.Win32ServiceMonitor" />  <monitor service="OpenNMS­JVM"     class­name="org.opennms.netmgt.poller.monitors.Jsr160Monitor" />  <monitor service="OuceProcess"     class­name="org.opennms.netmgt.poller.monitors.SnmpMonitor" /></poller­configuration>

Rescan to Discover Service

Distributed Monitoring

Maps Integration

Surveillance Views

Performance Data Collection

• Uses JRobin (or RRDTool) to store time series data

• Support for– SNMP (v1, v2c, v3)– JMX– HTTP– NSClient– WMI– SQL

• Automated configuration

Performance reports

# cat /tmp/ouce­collect.sh #!/bin/bashecho $RANDOM

# chmod +x /tmp/ouce­collect.sh 

# /tmp/ouce­collect.sh ok

In /etc/snmp/snmpd.confextend collect /tmp/ouce­collect.sh

SNMP Example with “extend”

# snmpwalk  ­v1 ­c public localhost .1.3.6.1.4.1.8072.1.3.2NET­SNMP­EXTEND­MIB::nsExtendNumEntries.0 = INTEGER: 1NET­SNMP­EXTEND­MIB::nsExtendCommand."collect" = STRING: /tmp/ouce­collect.shNET­SNMP­EXTEND­MIB::nsExtendArgs."collect" = STRING: NET­SNMP­EXTEND­MIB::nsExtendInput."collect" = STRING: NET­SNMP­EXTEND­MIB::nsExtendCacheTime."collect" = INTEGER: 5NET­SNMP­EXTEND­MIB::nsExtendExecType."collect" = INTEGER: exec(1)NET­SNMP­EXTEND­MIB::nsExtendRunType."collect" = INTEGER: run­on­read(1)NET­SNMP­EXTEND­MIB::nsExtendStorage."collect" = INTEGER: permanent(4)NET­SNMP­EXTEND­MIB::nsExtendStatus."collect" = INTEGER: active(1)NET­SNMP­EXTEND­MIB::nsExtendOutput1Line."collect" = STRING: 28984NET­SNMP­EXTEND­MIB::nsExtendOutputFull."collect" = STRING: 28984NET­SNMP­EXTEND­MIB::nsExtendOutNumLines."collect" = INTEGER: 1NET­SNMP­EXTEND­MIB::nsExtendResult."collect" = INTEGER: 0NET­SNMP­EXTEND­MIB::nsExtendOutLine."collect".1 = STRING: 28984

.1.3.6.1.4.1.8072.1.3.2.4.1.2.7.99.111.108.108.101.99.116.1 = STRING: 28984

MIB Output with extend

Add to the Foreign Source

KEY = .1.3.6.1.4.1.8072.1.3.2.4.1.2.7.99.111.108.108.101.99.116.1

Rescan to Discover

        <package name="OUCE example">                <filter>IPADDR != '0.0.0.0'</filter>                     <include­range begin="1.1.1.1" end="254.254.254.254"/>                                <service name="OuceCollect" interval="30000" user­defined="false" status="on">                        <parameter key="collection" value="ouce"/>                </service>        </package>                <collector service="SNMP" class­name="org.opennms.netmgt.collectd.SnmpCollector"/>        <collector service="WMI"  class­name="org.opennms.netmgt.collectd.WmiCollector"/>        <collector service="XMP"  class­name="org.opennms.netmgt.collectd.XmpCollector"/>        <collector service="OpenNMS­JVM" class­name="org.opennms.netmgt.collectd.Jsr160Collector"/>        <collector service="OuceCollect" class­name="org.opennms.netmgt.collectd.SnmpCollector"/></collectd­configuration>

Configure collectd-configuration.xml

  <snmp­collection name="ouce" snmpStorageFlag="select">    <rrd step="30">      <rra>RRA:AVERAGE:0.5:1:20160</rra>      <rra>RRA:AVERAGE:0.5:120:1488</rra>      <rra>RRA:AVERAGE:0.5:2880:366</rra>      <rra>RRA:MAX:0.5:2880:366</rra>      <rra>RRA:MIN:0.5:2880:366</rra>    </rrd>    <groups>      <group name="ouce­collect" ifType="ignore">        <mibObj oid=".1.3.6.1.4.1.8072.1.3.2.4.1.2.7.99.111.108.108.101.99.116"                 instance="1"                 alias="ouceCollect"                 type="gauge" />      </group>    </groups>    <systems>      <systemDef name="Net­SNMP">        <sysoidMask>.1.3.6.1.4.1.8072.3.</sysoidMask>        <collect>          <includeGroup>ouce­collect</includeGroup>        </collect>       </systemDef>    </systems>  </snmp­collection></datacollection­config>

Configure datacollection-config.xml

Verify Data Is Being Collected

# ls ­l /var/lib/opennms/rrd/snmp/1total 2916­rw­rw­r­­ 1 root root  37388 May 25 18:02 CpuRawIdle.jrb­rw­rw­r­­ 1 root root  37388 May 25 18:02 CpuRawInterrupt.jrb­rw­rw­r­­ 1 root root  37388 May 25 18:02 CpuRawKernel.jrb­rw­rw­r­­ 1 root root  37388 May 25 18:02 CpuRawNice.jrb­rw­rw­r­­ 1 root root  37388 May 25 18:02 CpuRawSoftIRQ.jrb­rw­rw­r­­ 1 root root  37388 May 25 18:02 CpuRawSystem.jrb­rw­rw­r­­ 1 root root  37388 May 25 18:02 CpuRawUser.jrb­rw­rw­r­­ 1 root root  37388 May 25 18:02 CpuRawWait.jrbdrwxrwxr­x 9 root root   4096 May 25 10:03 dskIndexdrwxrwxr­x 2 root root   4096 May 25 10:08 eth0­rw­rw­r­­ 1 root root  37388 May 25 18:02 hrMemorySize.jrb­rw­rw­r­­ 1 root root  37388 May 25 18:02 hrSystemNumUsers.jrb...

­rw­rw­r­­ 1 root root 182540 May 25 18:03 ouceCollect.jrb­rw­rw­r­­ 1 root root  37388 May 25 18:02 RawBlksSwapIn.jrb­rw­rw­r­­ 1 root root  37388 May 25 18:02 SwapIn.jrb­rw­rw­r­­ 1 root root  37388 May 25 18:02 SwapOut.jrb...

Create Report in snmp-graph.properties

report.ouce.collect.name=OUCE Collection Examplereport.ouce.collect.columns=ouceCollectreport.ouce.collect.type=nodeSnmpreport.ouce.collect.command=­­title="Random Value" \ DEF:value={rrd1}:ouceCollect:AVERAGE \ LINE2:value#0000ff:"Writes          " \ GPRINT:value:AVERAGE:"Avg  \\: %8.2lf %s" \ GPRINT:value:MIN:"Min  \\: %8.2lf %s" \ GPRINT:value:MAX:"Max  \\: %8.2lf %s\\n" 

(at the top)

reports=ouce.collect, mib2.HCbits, mib2.bits, mib2.percentdiscards, \mib2.percenterrors, \mib2.discards, mib2.errors, mib2.packets, \mib2.tcpopen, mib2.tcpcurrent, mib2.tcperrs, mib2.tcpsegs, \mib2.icmp.msgs, mib2.icmp.problems, mib2.icmp.info, mib2.icmp.echoes, \mib2.powerethernet, \mib2.traffic­inout, mib2.HCtraffic­inout, \mib2.ups­charge, mib2.ups­time, \

Choose the Resource Graph

Graph of Random Value

Add or Edit Threshold Group

Current Thresholds

Add New Basic Threshold

Tracking an eBay Auction

Figure Out the RegEx

<td colspan="4" height="10"></td></tr><tr><td colspan="4" class="vi-is1-bdr"><div class="vi-is1-tl"><div class="vi-is1-tr"></div></div></td></tr><tr><td class="vi-is1-lblp vi-is1-solidBg">Current bid:</td><td class="vi-is1-solid vi-is1-tbll"><span><span id="v4-32" class="vi-is1-prcp">US $390.00</span></span></td>

(?s).*?Current bid.*?US.*?([.0-9]+).*

Discovery and Collection

    In collectd­configuration.xml:

    <package name="ebay">        <filter>IPADDR != '0.0.0.0'</filter>        <include­range begin="1.1.1.1" end="254.254.254.254"/>        <service name="EbayAuction" interval="300000"            user­defined="false" status="on">            <parameter key="collection" value="ebay"/>            <parameter key="retry" value="1"/>            <parameter key="timeout" value="7000"/>        </service>    </package>

<collector service="EbayAuction"     class­name="org.opennms.netmgt.collectd.HttpCollector"/>

Define HTTP CollectionIn http­datacollection­config.xml:

    <uris>      <uri name="ebay">        <url path="/ws/eBayISAPI.dll?ViewItem&amp;item=190402522901"             virtual­host="cgi.ebay.com"             user­agent="Mozilla/5.0"              matches="(?s).*?Current bid.*?US.*?([.0­9]+).*"              response­range="100­399" >        </url>        <attributes>          <attrib alias="ebayprice" match­group="1" type="gauge32"/>        </attributes>      </uri>

$ ls ­l /opt/opennms/share/rrd/snmp/121total 288­rw­rw­r­­ 1 root root 282736 Jun 10 11:07 ebayprice.jrb

Create the Graph

In snmp­graph.properties:

report.example.ebay.name=This an Ebay Auctionreport.example.ebay.columns=ebaypricereport.example.ebay.type=nodeSnmpreport.example.ebay.command= \  ­­title="The price of a Nexus One eBay Auction" \  DEF:number={rrd1}:ebayprice:AVERAGE \  LINE2:number#00A000:"Price" \  GPRINT:number:AVERAGE:" Avg \\: %8.2lf %s" \  GPRINT:number:MIN:"Min \\: %8.2lf %s" \  GPRINT:number:MAX:"Max \\: %8.2lf %s\\n"

eBay Auction Graph

Configure Thresholds

• The Wiki: http://www.opennms.org/wiki/Mailing_lists

• The Mailing Lists– opennms-install– opennms-discuss– opennms-devel– opennms-announce

• IRC: #opennms on freenode.

The OpenNMS Project