Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.
Introduction to OpenNMS
POSSCON – 15 April 2015
Tarus Balog
tarus@opennms.org
Agenda for Workshop
• What the heck is OpenNMS?
• Getting It Installed
• The Net-SNMP Agent
• Provisioning and Discovery
•...
OpenNMS is the world's
first enterprise-grade
network management
application platform
developed under the
open source mode...
“world's first”
• NetSaint 2000-01-10 1323
• OpenNMS 2000-03-30 4141
• Nagios 2001-05-03 26589
• RRDTool 2003-01-13 71544
...
“enterprise-grade”
• Nearly 60,000 Devices on a Single
Instance (Swisscom)
• 1.2 Million Data Points Every Five
Minutes (N...
“network management
application platform”
The Architecture of OpenNMS has been
designed to allow for easy integration of
o...
“open source model”
OpenNMS is published under the
AGPLv3 and all components are
licensed under an OSI-qualified free
soft...
• Provisioning: Both Automated Discovery and Directed
Discovery.
• Event and Notification Management: Generate,
receive, r...
The Architecture
Network
PostgreSQL
RRD
RRD
RRD
RRD
RRD
Jetty/Tomcat
poller
JDBC
LDAP
DNS
HTTP
SMTP
IMAP
POP3
TCP
ICMP
Dis...
OpenNMS Versions
Let's Get This Sucker Installed
• Java JDK (7 or higher)
• PostgreSQL
• jicmp
• opennms-core
• Opennms-jetty-webapp
• ipli...
OpenNMS Packages in Debian
$ sudo apt­get install opennms
Reading package lists... Done
Building dependency tree       
Re...
Packages Are Your Friend
• Use “yum” on rpm-based distros
• Use “apt” on Debian/Ubuntu distros
• Use Solaris packages for ...
Getting Set Up
• The java to use must be set:
$OPENNMS_HOME/bin/runjava ­s
• The installer should be run:
$OPENMS_HOME/bin...
Start 'er Up
• Make sure the database is running and
is accessible on localhost:5432
• Start the Application:
$OPENNMS_HOM...
Where OpenNMS Stores Data
• Database (PostgreSQL)
• Round Robin Database (JRobin or
RRDtool) (/opt/opennms/share/rrd)
• Co...
javamail.properties
org.opennms.core.utils.fromAddress=ouce.tarus@gmail.com
# These properties define the SMTP Host.
#org....
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     
...
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...
/etc/snmp/snmpd.conf
(change listen address)
#############################################################################...
/etc/snmp/snmpd.conf
(change access control)
#############################################################################...
/etc/snmp/snmpd.conf
(change contact information)
########################################################################...
/etc/snmp/snmpd.conf
(enable non-free, install MIBs)
# vi /etc/apt/sources.list
deb http://ftp.utexas.edu/debian/ squeeze ...
/etc/snmp/snmp.conf
#
# As the snmp packages come without MIB files due to license reasons, loading
# of MIBs is disabled ...
Restart snmpd and Test
# invoke­rc.d snmpd restart
Restarting network management services: snmpd.
# snmpwalk ­v2c ­c publi...
See coldstart Events in OpenNMS
provisiond
• Controls both automated and directed
discovery
• The “foreign source” controls what gets
discovered
• The “fo...
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.36...
Enabled via ReST
Configure Automatic Discovery
<discovery­configuration
    threads="1"
    packets­per­second="1" 
    initial­sleep­time="30000"
    restart­sleep­time...
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 Ope...
Events
• OpenNMS can generate internal events,
receive external events such as SNMP
traps
• Events can be reduced – taking...
Event reduction
Automations
Automations
Automations
Create Custom Events
• OpenNMS listens on port 5817 for event
messages
• Events are simply properly formatted
XML objects
...
Unique Event Identifier
• A new interface is discovered:
uei.opennms.org/internal/discovery/newSuspect
• A service is down...
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</e...
$ tail eventconf.xml 
  <event­file>events/VMWare.events.xml</event­file>
  <event­file>events/Waverider.3000.events.xml</...
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 (...
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 s...
Service Assurance
• Monitor network services like HTTP, DNS,
Databases and even ICMP
• Calculate availability over devices...
Adaptable Downtime Model
• When an outage occurs, OpenNMS
changes the default service poll:
– 30 second polls for the firs...
Using Net-SNMP for SA
• Protocols like SSH don't scale and have
security issues
• Net-SNMP can be easily extended and
secu...
Create a Simple Script
# cat /tmp/ouce­process.sh
 
#!/bin/bash
echo ok
# chmod +x /tmp/ouce­process.sh 
# /tmp/ouce­proce...
Edit /etc/snmp/snmpd.conf
###########################################################
#
# EXTENDING THE AGENT
#
#
# Arbitr...
# snmpwalk ­v1 ­c public localhost .1.3.6.1.4.1.8072.1.3.2
NET­SNMP­EXTEND­MIB::nsExtendNumEntries.0 = INTEGER: 1
NET­SNMP...
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="...
Add Monitor at the Bottom
  <monitor service="Windows­Task­Scheduler" 
    class­name="org.opennms.netmgt.poller.monitors....
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
...
Performance reports
# cat /tmp/ouce­collect.sh
 
#!/bin/bash
echo $RANDOM
# chmod +x /tmp/ouce­collect.sh 
# /tmp/ouce­collect.sh 
ok
In /etc/...
# snmpwalk  ­v1 ­c public localhost .1.3.6.1.4.1.8072.1.3.2
NET­SNMP­EXTEND­MIB::nsExtendNumEntries.0 = INTEGER: 1
NET­SNM...
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­r...
  <snmp­collection name="ouce" snmpStorageFlag="select">
    <rrd step="30">
      <rra>RRA:AVERAGE:0.5:1:20160</rra>
    ...
Verify Data Is Being Collected
# ls ­l /var/lib/opennms/rrd/snmp/1
total 2916
­rw­rw­r­­ 1 root root  37388 May 25 18:02 C...
Create Report in snmp-graph.properties
report.ouce.collect.name=OUCE Collection Example
report.ouce.collect.columns=ouceCo...
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"><...
Discovery and Collection
    In collectd­configuration.xml:
    <package name="ebay">
        <filter>IPADDR != '0.0.0.0'<...
Define HTTP Collection
In http­datacollection­config.xml:
    <uris>
      <uri name="ebay">
        <url path="/ws/eBayIS...
Create the Graph
In snmp­graph.properties:
report.example.ebay.name=This an Ebay Auction
report.example.ebay.columns=ebayp...
eBay Auction Graph
Configure Thresholds
• The Wiki:
http://www.opennms.org/wiki/Mailing_lists
• The Mailing Lists
– opennms-install
– opennms-discuss
– opennms-de...
Introduction to OpenNMS
Introduction to OpenNMS
Introduction to OpenNMS
Introduction to OpenNMS
Introduction to OpenNMS
Introduction to OpenNMS
Introduction to OpenNMS
Introduction to OpenNMS
Introduction to OpenNMS
Nächste SlideShare
Wird geladen in …5
×

Introduction to OpenNMS

2.666 Aufrufe

Veröffentlicht am

Tarus Balog
OpenNMS - CEO
POSSCON 2015
4/15/2015
Operations Track - 9:45 AM Workshop

Veröffentlicht in: Technologie
  • Als Erste(r) kommentieren

Introduction to OpenNMS

  1. 1. Introduction to OpenNMS POSSCON – 15 April 2015 Tarus Balog tarus@opennms.org
  2. 2. 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
  3. 3. OpenNMS is the world's first enterprise-grade network management application platform developed under the open source model.
  4. 4. “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
  5. 5. “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)
  6. 6. “network management application platform” The Architecture of OpenNMS has been designed to allow for easy integration of other tools, both proprietary and open.
  7. 7. “open source model” OpenNMS is published under the AGPLv3 and all components are licensed under an OSI-qualified free software license.
  8. 8. • 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
  9. 9. The Architecture Network PostgreSQL RRD RRD RRD RRD RRD Jetty/Tomcat poller JDBC LDAP DNS HTTP SMTP IMAP POP3 TCP ICMP Discovery capsd/ provisiond (Capabilities Daemon)ICMPD EVENTD (Event Daemon) trapd (SNMP Trap Receiver) RTC ViewCategory Manager Users threshd collectd SNMP HTTP
  10. 10. OpenNMS Versions
  11. 11. Let's Get This Sucker Installed • Java JDK (7 or higher) • PostgreSQL • jicmp • opennms-core • Opennms-jetty-webapp • iplike • jrrd (optional)
  12. 12. OpenNMS Packages in Debian $ sudo apt­get install opennms Reading package lists... Done Building dependency tree        Reading state information... Done The 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­common Suggested 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.3 Recommended packages:   libnet­snmp­perl libxml2­utils libwww­perl libxml­twig­perl The 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­common 0 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] 
  13. 13. 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
  14. 14. 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.
  15. 15. 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
  16. 16. 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
  17. 17. javamail.properties org.opennms.core.utils.fromAddress=ouce.tarus@gmail.com # These properties define the SMTP Host. #org.opennms.core.utils.mailHost=127.0.0.1 org.opennms.core.utils.mailHost=smtp.gmail.com #org.opennms.core.utils.mailer=smtpsend #org.opennms.core.utils.transport=smtp org.opennms.core.utils.transport=smtps #org.opennms.core.utils.debug=true #org.opennms.core.utils.smtpport=25 org.opennms.core.utils.smtpport=465 #org.opennms.core.utils.smtpssl.enable=false org.opennms.core.utils.smtpssl.enable=true #org.opennms.core.utils.quitwait=true # These properties define the Mail authentication. #org.opennms.core.utils.authenticate=false org.opennms.core.utils.authenticate=true #org.opennms.core.utils.authenticateUser="opennms" org.opennms.core.utils.authenticateUser=tarus@gmail.com #org.opennms.core.utils.authenticatePassword=password org.opennms.core.utils.starttls.enable=false org.opennms.core.utils.starttls.enable=true # These properties configure message content #org.opennms.core.utils.messageContentType=text/plain org.opennms.core.utils.messageContentType=text/html #org.opennms.core.utils.charset=us­ascii org.opennms.core.utils.charset=UTF­8
  18. 18. Users, Groups and Roles
  19. 19. Add a Username and Password
  20. 20. Add User Information
  21. 21. Be Sure to Press “Finish”
  22. 22. New User Should Be Listed
  23. 23. 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 Daemon role.rtc.users=rtc role.rtc.notInDefaultGroup=true # This role allows users access to configuration and  # administrative web pages. role.admin.name=OpenNMS Administrator role.admin.users=admin,tarus
  24. 24. Login as New User
  25. 25. 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
  26. 26. /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
  27. 27. /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.1 view   systemonly  included   .1
  28. 28. /etc/snmp/snmpd.conf (change contact information) ############################################################################### # #  SYSTEM INFORMATION # #  Note that setting these values here, results in the corresponding MIB objects be #  See snmpd.conf(5) for more details sysLocation    IT­ology, 1301 Gervais St Suite 200, Columbia, SC 29201,                USA, North America, Earth sysContact     Tarus Balog <tarus@opennms.org>
  29. 29. /etc/snmp/snmpd.conf (enable non-free, install MIBs) # vi /etc/apt/sources.list deb http://ftp.utexas.edu/debian/ squeeze main non­free deb­src http://ftp.utexas.edu/debian/ squeeze main non­free # apt­get update # apt­get install snmp­mibs­downloader Reading package lists... Done Building dependency tree        Reading state information... Done The following extra packages will be installed:   smistrip Suggested packages:   unzip The following NEW packages will be installed:   smistrip snmp­mibs­downloader 0 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]? 
  30. 30. /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 :
  31. 31. Restart snmpd and Test # invoke­rc.d snmpd restart Restarting network management services: snmpd. # snmpwalk ­v2c ­c public localhost ipaddrtable IP­MIB::ipAdEntAddr.127.0.0.1 = IpAddress: 127.0.0.1 IP­MIB::ipAdEntAddr.192.168.54.134 = IpAddress: 192.168.54.134 IP­MIB::ipAdEntIfIndex.127.0.0.1 = INTEGER: 1 IP­MIB::ipAdEntIfIndex.192.168.54.134 = INTEGER: 2 IP­MIB::ipAdEntNetMask.127.0.0.1 = IpAddress: 255.0.0.0 IP­MIB::ipAdEntNetMask.192.168.54.134 = IpAddress: 255.255.255.0 IP­MIB::ipAdEntBcastAddr.127.0.0.1 = INTEGER: 0 IP­MIB::ipAdEntBcastAddr.192.168.54.134 = INTEGER: 1
  32. 32. See coldstart Events in OpenNMS
  33. 33. 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
  34. 34. Create a Provisiong Group
  35. 35. Create a Requisition
  36. 36. Add a localhost Device
  37. 37. Synchronize the Group
  38. 38. 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>
  39. 39. Enabled via ReST
  40. 40. Configure Automatic Discovery
  41. 41. <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>
  42. 42. A Requisition for a Virtual Node
  43. 43. Import Asset Information
  44. 44. Set Up Provisioning Policies
  45. 45. 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)
  46. 46. 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.
  47. 47. Event reduction
  48. 48. Automations
  49. 49. Automations
  50. 50. Automations
  51. 51. 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
  52. 52. 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
  53. 53. Create Custom UEIs $ /usr/share/opennms/bin/send­event.pl uei.ouce/demo/testEvent
  54. 54. Create Custom UEIs $ send­event.pl –severity 7 uei.ouce/demo/testEvent
  55. 55. $ 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
  56. 56. $ 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
  57. 57. View Formatted Event
  58. 58. View Formatted Alarm
  59. 59. 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
  60. 60. Destination Paths
  61. 61. Create a New Path
  62. 62. Add Targets
  63. 63. Chose A Method (one or more)
  64. 64. Create a New Notice
  65. 65. Define the Notice
  66. 66. Make Sure It Is On
  67. 67. Start/Stop Notices Globally
  68. 68. Run a Test • Send the OUCE event from earlier: /usr/share/opennms/bin/send­event.pl  uei.ouce/demo/testEvent • Verify it shows up
  69. 69. 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
  70. 70. 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
  71. 71. 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
  72. 72. Create a Simple Script # cat /tmp/ouce­process.sh   #!/bin/bash echo ok # chmod +x /tmp/ouce­process.sh  # /tmp/ouce­process.sh  ok
  73. 73. 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 restart Reloading network management services: snmpd.
  74. 74. # snmpwalk ­v1 ­c public localhost .1.3.6.1.4.1.8072.1.3.2 NET­SNMP­EXTEND­MIB::nsExtendNumEntries.0 = INTEGER: 1 NET­SNMP­EXTEND­MIB::nsExtendCommand."ouce" = STRING: /tmp/ouce­process.sh NET­SNMP­EXTEND­MIB::nsExtendArgs."ouce" = STRING:  NET­SNMP­EXTEND­MIB::nsExtendInput."ouce" = STRING:  NET­SNMP­EXTEND­MIB::nsExtendCacheTime."ouce" = INTEGER: 5 NET­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: ok NET­SNMP­EXTEND­MIB::nsExtendOutputFull."ouce" = STRING: ok NET­SNMP­EXTEND­MIB::nsExtendOutNumLines."ouce" = INTEGER: 1 NET­SNMP­EXTEND­MIB::nsExtendResult."ouce" = INTEGER: 0 NET­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
  75. 75. 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
  76. 76. 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>
  77. 77. 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>
  78. 78. Rescan to Discover Service
  79. 79. Distributed Monitoring
  80. 80. Maps Integration
  81. 81. Surveillance Views
  82. 82. 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
  83. 83. Performance reports
  84. 84. # cat /tmp/ouce­collect.sh   #!/bin/bash echo $RANDOM # chmod +x /tmp/ouce­collect.sh  # /tmp/ouce­collect.sh  ok In /etc/snmp/snmpd.conf extend collect /tmp/ouce­collect.sh SNMP Example with “extend”
  85. 85. # snmpwalk  ­v1 ­c public localhost .1.3.6.1.4.1.8072.1.3.2 NET­SNMP­EXTEND­MIB::nsExtendNumEntries.0 = INTEGER: 1 NET­SNMP­EXTEND­MIB::nsExtendCommand."collect" = STRING: /tmp/ouce­collect.sh NET­SNMP­EXTEND­MIB::nsExtendArgs."collect" = STRING:  NET­SNMP­EXTEND­MIB::nsExtendInput."collect" = STRING:  NET­SNMP­EXTEND­MIB::nsExtendCacheTime."collect" = INTEGER: 5 NET­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: 28984 NET­SNMP­EXTEND­MIB::nsExtendOutputFull."collect" = STRING: 28984 NET­SNMP­EXTEND­MIB::nsExtendOutNumLines."collect" = INTEGER: 1 NET­SNMP­EXTEND­MIB::nsExtendResult."collect" = INTEGER: 0 NET­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
  86. 86. 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
  87. 87. Rescan to Discover
  88. 88.         <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
  89. 89.   <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
  90. 90. Verify Data Is Being Collected # ls ­l /var/lib/opennms/rrd/snmp/1 total 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.jrb drwxrwxr­x 9 root root   4096 May 25 10:03 dskIndex drwxrwxr­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 ...
  91. 91. Create Report in snmp-graph.properties report.ouce.collect.name=OUCE Collection Example report.ouce.collect.columns=ouceCollect report.ouce.collect.type=nodeSnmp report.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 %sn"  (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, 
  92. 92. Choose the Resource Graph
  93. 93. Graph of Random Value
  94. 94. Add or Edit Threshold Group
  95. 95. Current Thresholds
  96. 96. Add New Basic Threshold
  97. 97. Tracking an eBay Auction
  98. 98. 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]+).*
  99. 99. 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"/>
  100. 100. Define HTTP Collection In 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/121 total 288 ­rw­rw­r­­ 1 root root 282736 Jun 10 11:07 ebayprice.jrb
  101. 101. Create the Graph In snmp­graph.properties: report.example.ebay.name=This an Ebay Auction report.example.ebay.columns=ebayprice report.example.ebay.type=nodeSnmp report.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 %sn"
  102. 102. eBay Auction Graph
  103. 103. Configure Thresholds
  104. 104. • 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

×