Você está na página 1de 147

OpenNMS Training

OpenNMS Standard Training


Provided by:

The OpenNMS Group, Inc.


Instructors:

Tarus Balog & David Hustace

OpenNMS Training Overview


The Basics
Duration: 2.5 Days Prerequisites: Entry level understanding of Linux Format: Hands-on, Instructor Led
P r o v i d e s e ac h st u d e nt w it h a fundamental understanding into the workings of the OpenNMS software as well as the systems, network devices, and agents it manages.

The Advanced Stuff


Duration: 2.5 Days Prerequisites: Basic Course Completion Format: Hands-on, Instructor Led
Provides a detailed understanding of the more advanced features and co n g u rat i o n s o f t h e O p e n N M S Software. This course builds on users work completed during the basic course by a ddressing real-world network management challenges.

The Basics Main Course Objectives


Able to install, congure, deploy, administer, & maintain OpenNMS following our best practices and security guidelines Able to congure the Net-SNMP agent to provide basic and detailed systems management information Able to customize the look, behavior, and operational notions of all of OpenNMS main features and functionalities

Basic Course Topics


Terminology Installation and Conguration Managing Events Provisioning Auto Discovery Service Assurance Data Collection and Graphing Notications
4

Basic Course Agenda

(Day 1-2.5)

Quick Background on OpenNMS High Level Architecture Review Installation Solution: Bringing Events Under Control Solution: Monitoring Disk Space

Basic Course Agenda


Auto-Discovery NOC Alarm handling and Web-UI customization
RTC Surveillance Views Dashboards Alarms Outages Notications Topology Maps
6

(Day 1-2.5)

Further Analysis
KSC Reports Statistical Reports (TopN/BottomN) SLA Reports Database Reports

Basic Course Agenda

(Day 1-2.5)

Non-SNMP Performance Management


HTTP Data Collection JMX Data Collection

Get Up to Date
Basic Course Labs

Stop OpenNMS (service opennms stop) Upgrade (yum install opennms) Deal with any .rpmnew les Run the installer (/opt/opennms/bin/install -dis) Clear the log les (rm -f /opt/opennms/logs/*/*) Start OpenNMS (service opennms start)

The Basics

From the Outside Looking In

OpenNMS is an Enterprise-grade Network Management Platform Developed Using the Open-Source Model It is
written in Java (well 99.999%) Congured via XML (human and machine readable) Uses a back-end database

10

Background
100% open source; Not fauxpen source License: GPL v2 25 Active Developers (OGP) Annual Developers Conference Focus on extreme scaleability and stability Complete build, unit-test, & packaging systems Registered: 2000-03-30 on SourceForge as Project 4141 http:/ /sourceforge.net/projects/opennms/ Project Stewardship: The OpenNMS Group, Inc.
11

Functions of OpenNMS
Provisioning
Automatic Discovery Directed Policy Supported

Monitoring
Service SLAs Application Status and Performance

Fault Management
Event Proxies Alarms Notications Reporting

Performance Management
Data Collection Thresholding Graphing

12

Features Of OpenNMS
Publish and Subscribe Event Bus Flexible Scalable Provisioning Pluggable Architecture Embedded Reporting Engine Topological and Geographical Mapping Web-UI ReST API Open Source Unit Tested Complete Build & Packaging System

13

Technical Overview
Architecture

OpenNMS Platform has 2 main Java applications:


Core: Java based NMS services container (Polling, Data Collection, etc.) GUI: JEE Web Application

2 JNI modules:
ICMP (Discovery and Polling) RRD (Response Time and Performance Graphing) (User Optional)

14

Schematic of Components
Architecture

External APIs IOC Container External APIs

Self Contained Java Process

ORM

Abstracted RRD Persistence Engine!

15

Publish and Subscribe Event Bus


Architecture

The Backbone of OpenNMSs Architecture Triggers everything! Asynchronous XML


Daemon conguration and event formatting via XML for easy customization XML message based UDP/TCP Proxy for easy integration

16

Interprocess Communications, Example


Architecture

Publish/ Subscribe Event Bus

Eventd

Discovery

Vacuumd

Collectd

Threshd

Service Daemons

1 - ICMP Echo Reply 2 - New Suspect Event 3 - SNMP Reply 4 Node Gained Service Event (SNMP) 5 - SNMP Poll Failure 6 - Node Lost Service Event (SNMP) 7 - Alarm Escalated Event 8 - Create Ticket Event

17

Ticketd

Alarmd

Notifd

Capsd

Poller

First Break
Basic Course: Day1

Be back in 15 minutes...

18

Start Rolling up the Sleeves


Basic Course Labs

19

Chapter 1
Managing Events

After completing this chapter, you will have an understanding on how events are managed within OpenNMS.

20

Use Cases
Chapter 1: Managing Events

My environment has a number of applications that all perform work and generate events. I want to bring all of those events into a single location.
Most programs have the ability to run an external command. Use this feature and the send-event.pl script to generate a custom event. Congure the event to display properly in OpenNMS

21

The Unique Event Identier (UEI)


Chapter 1: Managing Events

All Events in OpenNMS are identied by a unique string called the Unique Event Identier or UEI. Events in the OpenNMS format contain a UEI. Some common examples:
uei.opennms.org/nodes/nodeDown uei.opennms.org/nodes/interfaceDown uei.opennms.org/nodes/nodeLostService

Events from external sources, such as SNMP traps and Syslog messages, must have a UEI assigned.
22

The eventconf.xml le
Chapter 1: Managing Events

This le controls events All OpenNMS events are dened in this le Other event les can be included

23

eventconf.xml - security
Chapter 1: Managing Events

<global> <security> <doNotOverride>logmsg</doNotOverride> <doNotOverride>operaction</doNotOverride> <doNotOverride>autoaction</doNotOverride> <doNotOverride>tticket</doNotOverride> <doNotOverride>script</doNotOverride> </security> </global>

24

eventconf.xml - OpenNMS down event


Chapter 1: Managing Events

<event> <uei>uei.opennms.org/nodes/nodeLostService</uei> <event-label>OpenNMS-defined node event: nodeLostService</event-label> <descr> &lt;p&gt;A %service% outage was identified on interface %interface%. &lt;/p&gt; &lt;p&gt;A new Outage record has been created and service level availability calculations will be impacted until this outage is resolved.&lt;/p&gt; </descr> <logmsg dest="logndisplay">%service% outage identified on interface %interface% with reason code: %parm[eventReason]%. </logmsg> <severity>Minor</severity> <alarm-data reduction-key="%uei%:%dpname%:%nodeid%:%interface%:%service%" alarm-type="1" auto-clean="false"/> </event>

25

eventconf.xml - OpenNMS up event


Chapter 1: Managing Events <event> <uei>uei.opennms.org/nodes/nodeRegainedService</uei> <event-label>OpenNMS-defined node event: nodeRegainedService</event-label> <descr> &lt;p&gt;The %service% service on interface %interface% was previously down and has been restored.&lt;/p&gt; &lt;p&gt;This event is generated when a service which had previously failed polling attempts is again responding to polls by OpenNMS. &lt;/p&gt; &lt;p&gt;This event will cause any active outages associated with this service/interface combination to be cleared.&lt;/p&gt; </descr> <logmsg dest="logndisplay">The %service% outage on interface %interface% has been cleared. Service is restored. </logmsg> <severity>Normal</severity> <alarm-data reduction-key="%uei%:%dpname%:%nodeid%:%interface%:%service%" alarm-type="2" clear-key="uei.opennms.org/nodes/nodeLostService:%dpname%:%nodeid%:%interface%: %service%" auto-clean="false"/> </event>

26

eventconf.xml - Include other les


Chapter 1: Managing Events

<event-file>events/Rancid.events.xml</event-file> <event-file>events/3Com.events.xml</event-file> <event-file>events/AdaptecRaid.events.xml</event-file> <event-file>events/ADIC-v2.events.xml</event-file> <event-file>events/Adtran.events.xml</event-file> <event-file>events/Adtran.Atlas.events.xml</event-file> <event-file>events/Aedilis.events.xml</event-file> <event-file>events/AirDefense.events.xml</event-file> <event-file>events/AIX.events.xml</event-file> ... <event-file>events/programmatic.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>

26 27

eventd-conguration.xml
Chapter 1: Managing Events

<EventdConfiguration TCPAddress="*" TCPPort="5817" UDPAddress="*" UDPPort="5817" receivers="5" getNextEventID="SELECT nextval('eventsNxtId')" socketSoTimeoutRequired="yes" socketSoTimeoutPeriod="3000"> </EventdConfiguration>

26 28

send-event.pl
Chapter 1: Managing Events
Usage: /opt/opennms/bin/send-event.pl [host] [options] <UEI> Options: <UEI> [host[:port]] --version, -V --verbose, -v --help, -h --timezone, -t --service, -s --nodeid, -n --interface, -i --descr, -d --severity, -x the universal event identifier (URI) a hostname to send the event to (default: localhost) print version and exit successfully print the raw XML that's generated this help message the time zone you are in service name node identifier (numeric) IP address of the interface a description for the event browser the severity of the event (numeric or name) 1 = Indeterminate 2 = Cleared (unimplemented at this time) 3 = Normal 4 = Warning 5 = Minor 6 = Major 7 = Critical an event parameter (ie: --parm 'url http://www.google.com/') a UUID to pass with the event

--parm, -p --uuid, -U

Example: Force discovery of a node: send-event.pl \ --interface 172.16.1.1 \ uei.opennms.org/internal/discovery/newSuspect

26 29

Events - Hands-on Exercise


Events: Practical

Create a custom down event. Be sure to include alarm-data. Create a custom up event. Have this event clear the rst alarm. Insure your events work. Test overriding both the severity and logmsg.

30

Class.events.xml
Events: Practical
<events> <event> <uei>uei.opennms.org/class/downTest</uei> <event-label>AAA - Class Test Event - Down</event-label> <descr>&lt;p&gt; Oh my, something be broken! &lt;/p&gt; </descr> <logmsg dest='logndisplay'>&lt;p&gt;Down: Something be broken!&lt;/p&gt;</logmsg> <severity>Warning</severity> <alarm-data reduction-key="%uei%" alarm-type="1" auto-clean="false"/> </event> <event> <uei>uei.opennms.org/class/upTest</uei> <event-label>AAA - Class Test Event - Up</event-label> <descr>&lt;p&gt; Never mind, I was just kidding. &lt;/p&gt; </descr> <logmsg dest='logndisplay'>&lt;p&gt;Up: All better now.&lt;/p&gt;</logmsg> <severity>Normal</severity> <alarm-data reduction-key="%uei%" alarm-type="2" clear-key="uei.opennms.org/class/downTest" auto-clean="false"/> </event> </events>

26 31

Events - Hands-on Exercise


Events: Practical

Send the down event: send-event.pl uei.opennms.org/class/downTest Verify it shows up in both events and alarms Send the down event again. Verify it shows up twice in events, once in alarms. Send the down event with a severity: send-event.pl -x 7 uei.opennms.org/class/downTest Verify the event and alarm once again. Send the up event: send-event.pl uei.opennms.org/class/upTest Verify the event and alarms Wait 30 seconds and refresh the alarms. What happens?

30 32

Break Time

15 Minute Break

33

Chapter 2
Monitoring Disk Usage

After completing this chapter in the OpenNMS Basic Course, you will have a fundamental understanding for provisioning of monitored services in OpenNMS.

34

Use Cases
Chapter 2: Monitoring Disk Usage

An application often becomes unresponsive and/or unavailable to users due to the / (root) disk le system being full or nearly full.
Automatically notify the appropriate system administrators when the le system is at 80% capacity. Automatically notify all previous notied admins when problem is resolved. Bonus: Notify the appropriate system administrators when the le system capacity changes by 50%.

35

Building an SNMP Based Solution


Monitoring Disk Usage: Practical

Install an SNMP Agent on problematic system(s) Install a Network Management System (NMS) Congure Email notication infrastructure Add (Provision) the problematic system(s) in the NMS Congure threshold monitoring
In the NMS In the SNMP Agent

36

Install Net-SNMP
Monitoring Disk Usage: Practical

Install the Net-SNMP software


sudo yum install net-snmp net-snmp-utils sudo /sbin/chkcong snmpd on

Congure the Net-SNMP Agent


snmpconf: (congure snmpd) System Information: A descriptive Location Trap Destinations: v2c, localhost Various Aspects: disk space usage, /, 80% Access Control Setup (ro: YrUsonoZ, rw: 0p3nnms) sudo cp -p /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.orig sudo cp -p ./snmpd.conf /etc/snmp/snmpd.conf sudo /sbin/service snmpd start snmpwalk -v 2c -c YrUsonoZ localhost system
37

Installing OpenNMS
Monitoring Disk Usage: Practical

Install the OpenNMS software


sudo rpm -Uvh http:/ / yum.opennms.org/repoles/ opennms-repo-stablefc13.noarch.rpm sudo yum install opennms installs all OpenNMS packages: opennms, opennms-core, opennms-webapp-jetty, jicmp, installs Java: (typically openjdk-1.6.0) installs PostgreSQL: (the platforms stable release)

pg_hba.conf (hint: switch to user postgres) postgresql.conf (localhost access if necessary) sudo /sbin/service postgresql start sudo /sbin/chkcong postgresql on

Congure OpenNMS
sudo /opt/opennms/bin/runjava -fS /usr/bin/java sudo /opt/opennms/bin/install -dis sudo yum install iplike sudo /sbin/chkcong opennms on

Congure PostgreSQL
sudo /sbin/service postgresql initdb

Start OpenNMS
sudo /opt/opennms/bin/opennms start

38

Email Notications
Monitoring Disk Usage: Practical

Create a Gmail account OpenNMS


javamail-conguration.properties (see etc/examples)
org.opennms.core.utils.useJMTA=false org.opennms.core.utils.transport=smtps org.opennms.core.utils.mailHost=smtp.gmail.com org.opennms.core.utils.smtpport=465 org.opennms.core.utils.smtpssl.enable=true org.opennms.core.utils.authenticate=true org.opennms.core.utils.authenticateUser=xxxxxx@gmail.com org.opennms.core.utils.authenticatePassword=xxxxxxx org.opennms.core.utils.starttls.enable=true org.opennms.core.utils.messageContentType=text/html org.opennms.core.utils.charset=UTF-8

OpenNMS Web-UI create opennms user having the Gmail account and a member of the OpenNMS Admin Group enable notications Throw the main breaker for notications to On Set Threshold notications to On

39

Email Notications
(cont)
Monitoring Disk Usage: Practical

Create User Add their email address

Add them to the Admin Group

40

Email Notications
(cont)
Monitoring Disk Usage: Practical

Enable High Threshold Notications

Set Notication Breaker Switch

41

Active Thresholding
Monitoring Disk Usage: Practical

Congure Net-SNMP dskPercent Threshold


Admin/Manage Thresholds Edit netsnmp threshold group Edit ns-dskPercent Datasource Congure: threshold, re-arm & trigger values Add a resource lter for / le system

Create a temporary le to test threshold


(be verwy verwy careful!)
dd if=/dev/zero of=my1gb.file bs=1024 count=1000000

42

Congure Active Thresholding


(cont)
Monitoring Disk Usage: Practical

Edit dskPercent Threshold

Set threshold, re-arm & trigger w/ test values

43

Passive Thresholding
Monitoring Disk Usage: Practical

Monitored by the Agent Sent autonomously via message


SNMP Trap Syslog Other supported methods

Net-SNMP Style via /etc/snmp/snmpd.conf


# disk: Check for disk space usage of a partition. # The agent can check the amount of available disk space, and make # sure it is above a set limit. # # disk PATH [MIN=100000] # # PATH: mount path to the disk in question. # MIN: Disks with space below this value will have the Mib's errorFlag set. # Can be a raw integer value (units of kB) or a percentage followed by the % # symbol. Default value = 100000. # # The results are reported in the dskTable section of the UCD-SNMP-MIB tree disk / 80% monitor -r 10 -o dskPath -o dskPercent -o dskErrorMsg "dskTable" dskErrorFlag 0 1

44

Provision The System


Monitoring Disk Usage: Practical

Congure SNMP
Web-UI Admin/Congure Community Strings:
127.0.0.1:YrUsonoZ

Provision the system Create management-systems Provisioning Group Add Node with Primary SNMP Interface (127.0.0.1) and the ICMP and SNMP services Synchronize

45

Provision The System


(cont)
Monitoring Disk Usage: Practical

Congure SNMP community

Provision the Node

46

Provision The System


(cont)
Monitoring Disk Usage: Practical

Node is in inventory!

47

Break Time
Monitoring Disk Usage: Break

5-10 Minute break before lab

48

Hands On Lab
Monitoring Disk Usage: Student Lab

Its now your turn to complete the use cases for this lab. Be sure you complete the PreGame Checks!

49

Break Time
Monitoring Disk Usage: Break

Take a break! Stretch Get some coffee Well start a lecture to discuss the details of this exercise (zzzzz.....)

50

The Solution
Monitoring Disk Usage: Analysis

Software Packaging
RPM, DEB, PKG Dependency Management:YUM/APT OpenNMS Dependencies Java PostgreSQL JICMP Versions: Stable, Testing, Unstable Current Stable: 1.8.7 Current Unstable: 1.9.3
51

Installed Components
OpenNMS Net-SNMP PostgreSQL

The Why, What, and How?


Monitoring Disk Usage: Analysis

The use case provided a requirement for an NMS and an Agent


OpenNMS and Net-SNMP are Open Source and excellent choices

What is an NMS?
FCAPS (Generically Speaking) Fault Management Conguration Management Accounting Performance Management Security

What is an SNMP Agent?


RFC Governed (i.e. MIB-2) Private Enterprise Extensible User Extensible*

52

Whats all this SNMP Stuff?


Monitoring Disk Usage: Analysis

Some terms you heard thrown around: SNMP: Simple Network Management Protocol
TCP/IP Protocol UDP datagrams Ports 161, 162 Versions: 1, 2c, 3

ASN-1: Abstract Syntax Notation


The SNMP language for dening MIBs

MIB: Management Information Base


The SNMP data structure RFC 1052 published in 1988
53

The OID Tree


Monitoring Disk Usage: Analysis

ccitt (0)

iso (1)

joint-iso-ccitt (2)

standard (0)

member-body (2)

organization (3)

registration-authority (1)

department of defense (6)

internet (1)

54

The internet OID


Monitoring Disk Usage: Analysis

internet (.1.3.6.1)

directory (1) mgmt (2) experimental (3)

private (4)

mib-II (1)

enterprises (1)

55

Scalar and Columnar OIDs


Monitoring Disk Usage: Analysis

Scaler: ends in 0
sysDescr - .1.3.6.1.2.1.1.1.0

Columnar: ends in x.y


ifDescr - .1.3.6.1.2.1.2.2.1.2.3 This columnar references the 3rd interface (third row (y) in the ifTable, second object, which is the interface description column (x))

56

ASN.1 Example
Monitoring Disk Usage: Analysis

sysDescr OBJECT-TYPE SYNTAX DisplayString (SIZE(0..255)) MAX-ACCESS read-only STATUS current DESCRIPTION "A textual description of the entity. This value should include the full name and version identication of the system's hardware type, software operating-system, and networking software." ::= { system 1 }

57

MIB-II
Monitoring Disk Usage: Analysis

Most commonly referenced OIDs Supported by all* agents Provides generic metrics
System Group Interface Table IP Table Host-Resources Table etc.

58

Enterprises MIB
Monitoring Disk Usage: Analysis

OID: .1.3.6.1.4.1 Vendor numbers assigned by IANA Well known numbers:


IBM (2) Cisco (9) HP (11) OpenNMS (5813)

59

System OID
Monitoring Disk Usage: Analysis

sysObjectID (.1.3.6.1.2.1.1.2)
snmpget -v 2c -c YrUsonoZ localhost .1.3.6.1.2.1.1.2.0

Example sysObjectIDs Values


IBM RS/6000: ! ! .1.3.6.1.4.1.2.3.1.2.1.1.2 HP 9000/800 ! ! .1.3.6.1.4.1.11.2.3.2.3 HP 9000/700 ! ! .1.3.6.1.4.1.11.2.3.2.5 Microsoft Windows! .1.3.6.1.4.1.311.1.1.3.1 Bay Networks 28K Switch! ! ! .1.3.6.1.4.1.45.3.15.1 ! Net-SNMP, Linux: !.1.3.6.1.4.1.8072.3.2.10

60

SNMP Versions
Monitoring Disk Usage: Analysis

V1
Security: community names, no encyrption Simple protocol implications: Extremely powerful and easy to transport Extremely complex to instrument

V2c
Security Identical to v1 Results of V2 collaboration failure Improvements Added 64-bit counters Improved PDU structure and error handling Get-Bulks

V3
Security Supports pluggable privacy protocols Supports pluggable encryptions protocols

61

Conguring Net-SNMP
Monitoring Disk Usage: Analysis

Basic Conguration
Run the snmpconf utility trap2sink rocommunity rwcommunity syslocation syscontact

Advanced Conguration
View Based Access Control System Monitoring Process Checks Load Checks Disk Checks Executables

62

Conguring OpenNMS
Thresholds
Monitoring Disk Usage: Analysis

Threshold Methods
High Low Relative Change Absolute Value

Data Sources
MIB Objects Expressions

Resources (Datasource Types)


Node Interface Generic Resource Types

63

Conguring OpenNMS
Thresholds (cont)
Monitoring Disk Usage: Analysis

Threshold Type Object being collected from datacollection-cong.xml:


<mibObj oid=".1.3.6.1.4.1.2021.9.1.9" instance="dskIndex" alias="ns-dskPercent" type="gauge" />

Resource Type from datacollection-cong.xml:


<resourceType name="dskIndex" label="Disk Table Index (UCD-SNMP MIB)" resourceLabel="${ns-dskPath} (index ${index})"> <persistenceSelectorStrategy class="org.opennms.netmgt.collectd.PersistAllSelectorStrategy"/> <storageStrategy class="org.opennms.netmgt.dao.support.SiblingColumnStorageStrategy"> <parameter key="sibling-column-oid" value=".1.3.6.1.4.1.2021.9.1.2" /> <parameter key="replace-rst" value="s/^-$/_root_fs/" /> <parameter key="replace-all" value="s/^-/ /> /" <parameter key="replace-all" value="s/\\s/ /> /" <parameter key="replace-all" value="s/:\\\\.*/ /> /" </storageStrategy> </resourceType>

64

Conguring OpenNMS
SNMP
Monitoring Disk Usage: Analysis

XML Conguration
vim /opt/opennms/etc/snmp-cong.xml Supported Perl Script to send congure Web-UI: Admin/Congure SNMP by IP (Sends congure SNMP Event) Automatic snmp-cong optimization

65

SNMP Conguration
Auto-Optimized
Monitoring Disk Usage: Analysis
$ /opt/opennms/bin/send-event.pl uei.opennms.org/internal/configureSNMP \ --parm 'communityString public' --parm 'version v2c' --parm 'timeout 2000' --parm 'firstIPAddress 1.1.1.1' --parm 'lastIPAddress 5.5.5.5'
<definition timeout="2000" read-community="public" version="v2c"> <ns1:range xmlns:ns1="http://xmlns.opennms.org/xsd/types" begin="1.1.1.1" end="5.5.5.5"/> </definition>

$ /opt/opennms/bin/send-event.pl uei.opennms.org/internal/configureSNMP \ --parm 'communityString public' \ --parm 'firstIPAddress 1.1.1.10' \ --parm 'lastIPAddress 1.1.1.100' \ --parm 'version v2c'
<definition timeout="2000" read-community="public" version="v2c"> <ns1:range xmlns:ns1="http://xmlns.opennms.org/xsd/types" begin="1.1.1.1" end="1.1.1.9"/> <ns2:range xmlns:ns2="http://xmlns.opennms.org/xsd/types" begin="1.1.1.101" end="5.5.5.5"/> </definition> <definition retry="1" read-community="public" version="v2c"> <ns3:range xmlns:ns3="http://xmlns.opennms.org/xsd/types" begin="1.1.1.10" end="1.1.1.100"/> </definition>

66

Conguring OpenNMS
Provisioning Nodes
Monitoring Disk Usage: Analysis

Two forms of Provisioning


Auto-Discovery Directed

Directed
Add Interface Provisioning Groups

Auto-Discovery
Highly efcient Ping sweeper Generates New Suspect Events

Provisiond vs. Capsd


Capsd being deprecated Provisiond massively parallel asynchronous operations Capsd merges nodes

67

Conguring OpenNMS
Provisioning Nodes (cont)
Monitoring Disk Usage: Analysis

Now that Thresholds, Notications, and SNMP is congured, Provision your node(s).
Create an linux-systems Provisioning Group Dene the Linux System interface with ICMP and SNMP services and set P for SNMP Primary on the IP management interface Adjust the detectors as desired (Policies are discussed in Advanced Course)

68

Conguring OpenNMS
Provisioning Nodes (cont)
*Monitoring Disk Usage: Analysis

69

Break Time

15 Minute Break

70

Chapter 3
Monitoring Internet Search

After completing this chapter in the OpenNMS Basic Course, you will have a complete understanding for creating new services, Status Views, and Notication Workows.

71

Internet Search Monitoring Use Cases


Chapter 3: Monitoring Internet Search

The availability and performance of Internet (and Cloud) based web services has become extremely critical to your organization. Congure OpenNMS to provide comprehensive monitoring support the security (rewall) and network admin teams.
Notify the rewall on-call team when the Search service fails on one of 3 main Internet web search sites. Notify network the admin team when ICMP fails on one of 3 main Internet web search sites. Notify network on-call team when the Internet is down. Provide the network and rewall teams with comprehensive status views and dashboards of their respective services. Provide the network and rewall teams with comprehensive reporting of their respective services.
72

Building an Internet Search Monitoring Solution


Monitoring Internet Search: Practical

Create custom notication workows for the rewall and the network admin teams Add Custom Search Monitoring Services Use StrafePing to provide detailed ICMP Analysis of Internet Search Sites Create a Node in OpenNMS that represents the Internet Search service from Google, Yahoo, & Bing Customize OpenNMS with Surveillance Views, Site Status Views, Custom RTC, and Dashboards
73

Security and Network Team Notications and Status Views


Monitoring Internet Search: Practical

Dene Search Services


capsd-conguration poller-conguration

Create On-Call Role Calendars


Security On-Call Networking On-Call

Create Users
Security Team Superman Batman Wonder Woman Network Team Fantastic Invisible Girl Torch ThingCreate Groups Security Networking

Create Destination Paths


Security: Urgent & non-Urgent Networking: Urgent & non-Urgent

Create Surveillance Categories Create RTC Categories Create the Views


Surveillance Views RTC Dashboards

74

Registering New Services


Monitoring Internet Search: Practical

Dene/Register the Services in OpenNMS

capsd-conguration.xml
<protocol-plugin protocol="GoogleSearch" class-name="org.opennms.netmgt.capsd.plugins.HttpPlugin" scan="off" /> <protocol-plugin protocol="YahooSearch" class-name="org.opennms.netmgt.capsd.plugins.HttpPlugin" scan="off" /> <protocol-plugin protocol="BingSearch" class-name="org.opennms.netmgt.capsd.plugins.HttpPlugin" scan="off" />

Notice the different XML closure than scene in the default conguration

75

Conguring New Services for Monitoring


Monitoring Internet Search: Practical

Congure the Polling of the Services into a separate polling package.


<package name="search"> <filter>catincNetworking | catincSecurity</filter> <include-range begin="1.1.1.1" end="255.255.255.255" /> <rrd step="300"> <rra>RRA:AVERAGE:0.5:1:2016</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="BingSearch" interval="30000" user-defined="false" status="on"> <parameter key="url" value="/" /> <parameter key="rrd-repository" value="/opt/opennms/share/rrd/response" /> <parameter key="rrd-base-name" value="BingSearch" /> <parameter key="ds-name" value="BingSearch" /> </service> <service name="GoogleSearch" interval="30000" user-defined="false" status="on"> <parameter key="url" value="/" /> <parameter key="rrd-repository" value="/opt/opennms/share/rrd/response" /> <parameter key="rrd-base-name" value="GoogleSearch" /> <parameter key="ds-name" value="GoogleSearch" /> </service> <service name="YahooSearch" interval="30000" user-defined="false" status="on"> <parameter key="url" value="/" /> <parameter key="rrd-repository" value="/opt/opennms/share/rrd/response" /> <parameter key="rrd-base-name" value="YahooSearch" /> <parameter key="ds-name" value="YahooSearch" /> </service> <service name="StrafePing" interval="300000" user-defined="false" status="on"> <parameter key="retry" value="0" /> <parameter key="timeout" value="3000" /> <parameter key="ping-count" value="20" /> <parameter key="failure-ping-count" value="20" /> <parameter key="wait-interval" value="50" /> <parameter key="rrd-repository" value="/opt/opennms/share/rrd/response" /> <parameter key="rrd-base-name" value="strafeping" /> </service> <downtime interval="300000" begin="0" /><!-- 5m, 0, 5d --> </package>

poller-conguration.xml

76

Conguring New Services for Monitoring (cont)


Monitoring Internet Search: Practical

Congure the Polling of the Services by dening the monitor classes for each service
poller-conguration.xml

<monitor service="BingSearch" class-name="org.opennms.netmgt.poller.monitors.HttpMonitor" /> <monitor service="GoogleSearch" class-name="org.opennms.netmgt.poller.monitors.HttpMonitor" /> <monitor service="YahooSearch" class-name="org.opennms.netmgt.poller.monitors.HttpMonitor" />

Restart OpenNMS

77

Creating Users
Monitoring Internet Search: Practical
Create all users with a 9-5 duty schedule (they are Super Heros after all!) and add your email address to one of the heros in each group.

78

Creating Groups
Monitoring Internet Search: Practical

Create the Groups and add the Users

79

Creating On-Call Role Calendars


Monitoring Internet Search: Practical

Create the On-Call Role Calendars for each team

80

Notication Workow
Monitoring Internet Search: Practical

Create the Urgent Destination Paths for each team

81

Notication Workow (cont)


Monitoring Internet Search: Practical

Create the Urgent Destination Paths for each team

82

Dening the Notication


Monitoring Internet Search: Practical

Dene Search Service Notication for the Security Team

83

Dening the Notication (cont)


Monitoring Internet Search: Practical

Dene Search Service Notication for the Security Team (cont)

Security Teams urgent notication path Set the Search services


84

Dening the Networking Team Notication


Monitoring Internet Search: Practical

Dene Search Service Notication for the Networking Team

85

Dening the Networking Team Notication (cont)


Monitoring Internet Search: Practical

Dene Search Service Notication for the Networking Team (cont)

Networking Teams urgent notication path Set the Search services


86

Adding Search Service to the RTC Console


Monitoring Internet Search: Practical

Create RTC (Reporting) Category Search Services useful for:


ltering notications displaying real-time availability

categories.xml
... <category> <label><![CDATA[Search Services]]></label> <comment>This category includes all managed interfaces which are currently providing Google, Yahoo, and Bloomberg Search services</comment> <normal>99.99</normal> <warning>97</warning> <service>GoogleSearch</service> <service>YahooSearch</service> <service>BingSearch</service> <rule><![CDATA[isGoogleSearch | isYahooSearch | isBingSearch]]></rule> </category> ...

87

Adding Search Service to the RTC Console (cont)


Monitoring Internet Search: Practical

Add New Category to the RTC display conguration


<?xml version="1.0"?> <viewinfo> <view> <view-name>WebConsoleView</view-name> <section> <section-name><![CDATA[Categories]]></section-name> <category><![CDATA[Search Services]]></category> <category><![CDATA[Network Interfaces]]></category> <category><![CDATA[Web Servers]]></category> <category><![CDATA[Email Servers]]></category> <category><![CDATA[DNS and DHCP Servers]]></category> <category><![CDATA[Database Servers]]></category> <category><![CDATA[JMX Servers]]></category> <category><![CDATA[Other Servers]]></category> </section> <section> <section-name><![CDATA[Total]]></section-name> <category><![CDATA[Overall Service Availability]]></category> </section> </view> </viewinfo>

views-display.xml

88

Create Surveillance Views


Monitoring Internet Search: Practical

Create Surveillance Categories to organize status views for each team


Security Firewalls Networking Search

89

Create Surveillance Views (cont)


Monitoring Internet Search: Practical

Create Surveillance a View called: Search


<view name="search" refresh-seconds="300" > <rows> <row-def label="Search Services" > <category name="Search"/> </row-def> </rows> <columns> <column-def label="PROD" > <category name="Production" /> </column-def> <column-def label="TEST" > <category name="Test" /> </column-def> <column-def label="DEV" > <category name="Development" /> </column-def> </columns> </view>

90

Create Surveillance Views for Team Dashboards (cont)


Monitoring Internet Search: Practical

Congure the dashboards for each of the users in the Security and Networking Groups
<view name="Security" refresh-seconds="300" > <rows> <row-def label="Security Search Services" > <category name="Search"/> <category name="Security"/> </row-def> </rows> <columns> <column-def label="PROD" > <category name="Production" /> </column-def> <column-def label="TEST" > <category name="Test" /> </column-def> <column-def label="DEV" > <category name="Development" /> </column-def> </columns> </view> <view name="Networking" refresh-seconds="300" > <rows> <row-def label="Security Search Services" > <category name="Search"/> <category name="Networking"/> </row-def> </rows> <columns> <column-def label="PROD" > <category name="Production" /> </column-def> <column-def label="TEST" > <category name="Test" /> </column-def> <column-def label="DEV" > <category name="Development" /> </column-def> </columns> </view>

91

Superman Dashboard Test


Monitoring Internet Search: Practical

Login as user superman and select the Dashboard Menu


Gets the Security Dashboard

92

Providing the Search Services


Monitoring Internet Search: Practical

Provide all the Search services on 1 node

93

Break Time
Monitoring Internet Search: Student Lab

5-10 Minute break before lab

94

Hands On Lab
Monitoring Internet Search: Student Lab

1. Complete the conguration supplied in the practical exercise for you OpenNMS instance. 2. Simulate the Google Interface down and verify the notications.

95

Break Time
Monitoring Internet Search: Student Lab

Take a break! Stretch Get some coffee Well start a lecture to discuss the details of this exercise (zzzzz.....)

96

Conguring OpenNMS
Notications
Monitoring Internet Search: Analysis

Targets
Users w/ Duty Schedules Groups w/ Duty Schedules Roles w/ On-Call Calendars

Notication Commands
Built-in Java Classes External System Commands

Destination Paths
Provides complex workows Unlimited escalations

Path Outages
User congurable Layer3 Topology Suppresses Notication of Downstream Alarms
97

Conguring OpenNMS
Notications (cont)
Monitoring Internet Search: Analysis

Complex Workow Example


NOC W/ On-Call Pager

Create Users with Duty Schedule (e.g. 0700 1600) Create SysAdmin Group with general Duty Schedule (e.g. 07 - 1900) Create On-Call Role for SysAdmin Group Create non-urgent Destination Path sending notications to SysAdmin Group Create urgent Destination Path sending notications to SysAdmin Group + On-Call Role
98

Conguring OpenNMS
Notications (cont)
Monitoring Internet Search: Analysis

U sched in Role?

Notify

G on Duty?

U on Duty?

Queue

Notify
99

Break Time

10 Minute Break

100

Chapter 4
Getting Graphical

After completing this chapter in the OpenNMS Basic Course, you will have a complete understanding for creating performance graphs and topological maps.

101

Use Case
Getting Graphical

Create Graphs for Search Services Provide the Security and Networking teams with Topological Maps that show the status of each OpenNMS Instance
Student 1: Massachusetts Student 2: North Carolina Student 3: Georgia Student 4: Ohio Student 5: Minnesota Student 6: Colorado Student 7: Oregon
102

Dene the 3 New Graphs


Getting Graphical

#report keys, list ALL prefab reports here! reports=icmp, avail, dhcp, dns, http, http-8000, http-8080, mail, pop3, radius, smtp, ssh, jboss, snmp, ldap, strafeping, bingsearch, googlesearch, yahoosearch

response-graph.properties

103

Create the Graph for the BloombergSearch Service


Getting Graphical
report.bingsearch.name=BingSearch report.bingsearch.columns=BingSearch report.bingsearch.type=responseTime, distributedStatus report.bingsearch.command=--title="BingSearch Response Time" \ --vertical-label="Seconds" \ DEF:rtMills={rrd1}:BingSearch:AVERAGE \ DEF:minRtMills={rrd1}:BingSearch:MIN \ DEF:maxRtMills={rrd1}:BinggSearch:MAX \ CDEF:rt=rtMills,1000,/ \ report.googlesearch.name=GoogleSearch CDEF:minRt=minRtMills,1000,/ \ report.googlesearch.columns=GoogleSearch CDEF:maxRt=maxRtMills,1000,/ \ report.googlesearch.type=responseTime, distributedStatus LINE1:rt#0000ff:"Response Time" \ report.googlesearch.command=--title="GoogleSearch Response Time" \ GPRINT:rt:AVERAGE:" Avg \\: %8.2lf %s" \ --vertical-label="Seconds" \ GPRINT:rt:MIN:"Min \\: %8.2lf %s" \ DEF:rtMills={rrd1}:GoogleSearch:AVERAGE \ GPRINT:rt:MAX:"Max \\: %8.2lf %s\\n" DEF:minRtMills={rrd1}:GoogleSearch:MIN \ DEF:maxRtMills={rrd1}:GoogleSearch:MAX \ CDEF:rt=rtMills,1000,/ \ CDEF:minRt=minRtMills,1000,/ \ CDEF:maxRt=maxRtMills,1000,/ \ LINE1:rt#0000ff:"Response Time" \ GPRINT:rt:AVERAGE:" Avg \\: %8.2lf %s" \ GPRINT:rt:MIN:"Min \\: %8.2lf %s" \ GPRINT:rt:MAX:"Max \\: %8.2lf %s\\n" report.yahoosearch.name=YahooSearch report.yahoosearch.columns=YahooSearch report.yahoosearch.type=responseTime, distributedStatus report.yahoosearch.command=--title="YahooSearch Response Time" \ --vertical-label="Seconds" \ DEF:rtMills={rrd1}:YahooSearch:AVERAGE \ DEF:minRtMills={rrd1}:YahooSearch:MIN \ DEF:maxRtMills={rrd1}:YahooSearch:MAX \ CDEF:rt=rtMills,1000,/ \ CDEF:minRt=minRtMills,1000,/ \ CDEF:maxRt=maxRtMills,1000,/ \ LINE1:rt#0000ff:"Response Time" \ GPRINT:rt:AVERAGE:" Avg \\: %8.2lf %s" \ GPRINT:rt:MIN:"Min \\: %8.2lf %s" \ GPRINT:rt:MAX:"Max \\: %8.2lf %s\\n"

104

Viewing the Graphs


Getting Graphical

Click Graph to activate Zoom

105

Strafe Ping
Getting Graphical

http:/ /www.opennms.org/wiki/StrafePing

106

Provision the Nodes


Getting Graphical

Provision all the student NMSs

107

Creating the Topology Map


Getting Graphical

Steps to creating a Map


Login as admin and click the Map Menu Select Map/Admin Mode Select Map/New Select Map/Background/Image (choose USA and Set BG) Select Node/Add (add all nodes and move) Select Map/Rename (type: ClassUSA) Select Map/Save Select Map/Refresh Mode

108

Completed Map
Getting Graphical

109

Break Time
Getting Graphical

5 Minute Break before the Lab

110

Lab 1
Getting Graphical

Complete the practical exercise Create a static bit bucket route for one of the student nodes and view the outage on the Map
route add -host 172.20.1.202 gw 127.0.0.1

111

Break Time
Getting Graphical

10 Minute Break before the next Chapter

112

Chapter 5
Monitoring an Application: OpenNMS

After completing this chapter, you will have basic knowledge and understanding of the and concepts can capabilities of OpenNMSs extensible data collection engine.

113

Use Case
Monitoring an Application: OpenNMS

By the end of this combined course, OpenNMS will be securely congured and dependent on multiple system and application components: Java VM, Apache HTTPd, and Linux system resources (CPU, disk, etc.) Provide performance graphs of each of these critical components for trending and analysis.

114

Building the Solution


Monitoring an Application: OpenNMS

Enable Apache:httpd w/ mod_status on your NMS Congure HTTP style data collection for Apache HTTPd stats. Congure Apache:httpd performance graphs Modify the provisioning requisition from Chapter-1 to include the HTTP, OpenNMS-JVM, OpenNMSLogin services. Create KSC Report for HTTP and OpenNMS Login service response times, HTTP collected Apache:httpd stats, System CPU and Disk Resources, and OpenNMS JMX statistics.
115

Install and Congure HTTPd


Monitoring an Application: OpenNMS

sudo yum install httpd sudo /sbin/chkcong httpd on httpd.conf


<Location /server-status> SetHandler server-status Order deny,allow Deny from all Allow from 172.0.0.0/8 </Location> ExtendedStatus On

sudo /sbin/service httpd start


116

Register OpenNMS-Login Service


Monitoring an Application: OpenNMS

capsd-conguration
<protocol-plugin protocol="OpenNMS-Login" class-name="org.opennms.netmgt.capsd.plugins.HttpPlugin" scan="off" user-defined="false"> </protocol-plugin>

117

Dene Polling for OpenNMS-Login Service


Monitoring an Application: OpenNMS

poller-conguration
<service name="OpenNMS-Login" interval="300000" user-defined="true" status="on"> <parameter key="retry" value="1"/> <parameter key="timeout" value="5000"/> <parameter key=port value=8980 /> <parameter key=url value=/opennms/login.jsp /> <parameter key="rrd-repository" value="/opt/opennms/share/rrd/response"/> <parameter key=rrd-base-name value=opennms-login /> <parameter key="ds-name" value="opennms-login"/> </service> ... <monitor service="OpenNMSLogin" class-name="org.opennms.netmgt.poller.monitors.HttpMonitor"/>

118

Create Response Time Graphs


Monitoring an Application: OpenNMS
... reports=icmp, avail, dhcp, dns, http, http-8000, http-8080, mail, pop3, radius, smtp, ssh, jboss, snmp, ldap, strafeping, opennms-login, opennms-jvm ... report.opennms-login.name=OpenNMS-Login report.opennms-login.columns=opennms-login report.opennms-login.type=responseTime, distributedStatus report.opennms-login.command=--title="OpenNMS Login Response Time" \ --vertical-label="Seconds" \ DEF:rtMills={rrd1}:opennms-login:AVERAGE \ DEF:minRtMills={rrd1}:opennms-login:MIN \ DEF:maxRtMills={rrd1}:opennms-login:MAX \ CDEF:rt=rtMills,1000,/ \ CDEF:minRt=minRtMills,1000,/ \ CDEF:maxRt=maxRtMills,1000,/ \ LINE1:rt#0000ff:"Response Time" \ GPRINT:rt:AVERAGE:" Avg \\: %8.2lf %s" \ GPRINT:rt:MIN:"Min \\: %8.2lf %s" \ GPRINT:rt:MAX:"Max \\: %8.2lf %s\\n"

response-graph.properties

report.opennms-jvm.name=OpenNMS-JVM report.opennms-jvm.columns=opennms-jvm report.opennms-jvm.type=responseTime, distributedStatus report.opennms-jvm.command=--title="OpenNMS JVM Response Time" \ --vertical-label="Seconds" \ DEF:rtMills={rrd1}:opennms-jvm:AVERAGE \ DEF:minRtMills={rrd1}:opennms-jvm:MIN \ DEF:maxRtMills={rrd1}:opennms-jvm:MAX \ CDEF:rt=rtMills,1000,/ \ CDEF:minRt=minRtMills,1000,/ \ CDEF:maxRt=maxRtMills,1000,/ \ LINE1:rt#0000ff:"Response Time" \ GPRINT:rt:AVERAGE:" Avg \\: %8.2lf %s" \ GPRINT:rt:MIN:"Min \\: %8.2lf %s" \ GPRINT:rt:MAX:"Max \\: %8.2lf %s\\n"

119

Congure HTTP Data Collection


Monitoring an Application: OpenNMS
<http-collection name="apache-stats"> <rrd step="30"> <rra>RRA:AVERAGE:0.5:1:2016</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> <uris> <uri name="server-status"> <url path="/server-status/?auto" user-agent="OpenNMS/1.8 (HttpCollector)" matches=".*Total\s+Accesses:\s+(\d+).*?Total\s+[Kk][Bb]ytes:\s+ (\d+).*?CPU\s*Load:\s+([0-9.Ee-]+).*?Uptime:\s+(\d+).*?BusyWorkers:\s+(\d+).*? IdleWorkers:\s+(\d+).*" response-range="100-399" dotall="true" > </url> <attributes> <attrib alias="apacheAccesses" match-group="1" type="counter" /> <attrib alias="apacheKBServed" match-group="2" type="counter" /> <attrib alias="apacheCpuLoad" match-group="3" type="gauge" /> <attrib alias="apacheUptime" match-group="4" type="gauge" /> <attrib alias="apacheBusyWorkers" match-group="5" type="gauge" /> <attrib alias="apacheIdleWorkers" match-group="6" type="gauge" /> </attributes> </uri> </uris> </http-collection>

http-datacollection-cong

120

Dene the HTTP Service Collector


Monitoring an Application: OpenNMS

collectd-conguration
<service name="HTTP" interval="30000" user-defined="false" status="on"> <parameter key="collection" value="apache-stats"/> <parameter key="thresholding-enabled" value="true"/> </service> ... <collector service="HTTP" class-name="org.opennms.netmgt.collectd.HttpCollector"/>

121

Create Apache Graphs


Monitoring an Application: OpenNMS
... apache.server-status.accesses, apache.server-status.request-rate, \ apache.server-status.bytes, apache.server-status.request-size, \ apache.server-status.cpuload, apache.server-status.uptime, \ apache.server-status.workers ... report.apache.server-status.accesses.name=Apache HTTPD Requests Served report.apache.server-status.accesses.columns=apacheAccesses report.apache.server-status.accesses.type=nodeSnmp report.apache.server-status.accesses.command=--title="Apache HTTPD Requests Served" \ --vertical-label="Requests / sec" \ DEF:req={rrd1}:apacheAccesses:AVERAGE \ AREA:req#0000ff:"Requests" \ GPRINT:req:AVERAGE:"Avg \\: %8.2lf" \ GPRINT:req:MIN:"Min \\: %8.2lf" \ GPRINT:req:MAX:"Max \\: %8.2lf\\n"

snmp-graph.properties

report.apache.server-status.request-rate.name=Apache HTTPD Average Request Rate report.apache.server-status.request-rate.columns=apacheAccesses,apacheUptime report.apache.server-status.request-rate.type=nodeSnmp report.apache.server-status.request-rate.command=--title="Apache HTTPD Average Request Rate" \ --vertical-label="Requests / sec" \ COMMENT:"Note\\: Rate calculated since HTTPD last started\\n" \ COMMENT:"\\n" \ DEF:req={rrd1}:apacheAccesses:AVERAGE \ DEF:time={rrd2}:apacheUptime:AVERAGE \ CDEF:rate=req,time,/ \ AREA:rate#0000ff:"Requests" \ GPRINT:rate:AVERAGE:"Avg \\: %8.2lf" \ GPRINT:rate:MIN:"Min \\: %8.2lf" \ GPRINT:rate:MAX:"Max \\: %8.2lf\\n"

122

Create Apache Graphs


Monitoring an Application: OpenNMS
report.apache.server-status.bytes.name=Apache HTTPD Bytes Served report.apache.server-status.bytes.columns=apacheKBServed report.apache.server-status.bytes.type=nodeSnmp report.apache.server-status.bytes.command=--title="Apache HTTPD Bytes Served" \ --vertical-label="Bytes" \ DEF:kbytes={rrd1}:apacheKBServed:AVERAGE \ CDEF:bytes=kbytes,1024,* \ AREA:bytes#0000ff:"Requests" \ GPRINT:bytes:AVERAGE:"Avg \\: %8.2lf %s" \ GPRINT:bytes:MIN:"Min \\: %8.2lf %s" \ GPRINT:bytes:MAX:"Max \\: %8.2lf %s\\n" report.apache.server-status.request-size.name=Apache HTTPD Average Request Size report.apache.server-status.request-size.columns=apacheAccesses,apacheKBServed report.apache.server-status.request-size.type=nodeSnmp report.apache.server-status.request-size.command=--title="Apache HTTPD Average Request Size" \ --vertical-label="Bytes" \ DEF:req={rrd1}:apacheAccesses:AVERAGE \ DEF:kbytes={rrd2}:apacheKBServed:AVERAGE \ CDEF:bytes=kbytes,1024,* \ CDEF:size=bytes,req,/ \ COMMENT:"Note\\: Rate calculated since HTTPD last started\\n" \ COMMENT:"\\n" \ AREA:size#0000ff:"Bytes" \ GPRINT:size:AVERAGE:"Avg \\: %8.2lf %s" \ GPRINT:size:MIN:"Min \\: %8.2lf %s" \ GPRINT:size:MAX:"Max \\: %8.2lf %s\\n"

snmp-graph.properties

123

Create Apache Graphs


Monitoring an Application: OpenNMS report.apache.server-status.cpuload.name=Apache HTTPD CPU Load report.apache.server-status.cpuload.columns=apacheCpuLoad report.apache.server-status.cpuload.type=nodeSnmp report.apache.server-status.cpuload.command=--title="Apache HTTPD CPU Load" \ --vertical-label="Percent" \ --lower-limit=0 --upper-limit=100 \ DEF:load={rrd1}:apacheCpuLoad:AVERAGE \ AREA:load#0000ff:"CPU Load" \ GPRINT:load:AVERAGE:"Avg \\: %8.2lf" \ GPRINT:load:MIN:"Min \\: %8.2lf" \ GPRINT:load:MAX:"Max \\: %8.2lf\\n"

snmp-graph.properties

report.apache.server-status.uptime.name=Apache HTTPD Uptime report.apache.server-status.uptime.columns=apacheUptime report.apache.server-status.uptime.type=nodeSnmp report.apache.server-status.uptime.command=--title="Apache HTTPD Uptime" \ --vertical-label="Days" \ DEF:sec={rrd1}:apacheUptime:AVERAGE \ CDEF:days=sec,86400,/ \ AREA:days#0000ff:"HTTPD Uptime" \ GPRINT:days:AVERAGE:"Avg \\: %8.2lf" \ GPRINT:days:MIN:"Min \\: %8.2lf" \ GPRINT:days:MAX:"Max \\: %8.2lf\\n"

124

Create Apache Graphs


Monitoring an Application: OpenNMS report.apache.server-status.workers.name=Apache HTTPD Workers report.apache.serverstatus.workers.columns=apacheBusyWorkers,apacheIdleWorkers report.apache.server-status.workers.type=nodeSnmp report.apache.server-status.workers.command=--title="Apache HTTPD Workers" \ --vertical-label="Workers" \ DEF:busy={rrd1}:apacheBusyWorkers:AVERAGE \ DEF:idle={rrd2}:apacheIdleWorkers:AVERAGE \ CDEF:total=busy,idle,+ \ LINE2:busy#0000ff:"Busy " \ GPRINT:busy:AVERAGE:"Avg \\: %8.2lf" \ GPRINT:busy:MIN:"Min \\: %8.2lf" \ GPRINT:busy:MAX:"Max \\: %8.2lf\\n" \ LINE2:idle#00ff00:"Idle " \ GPRINT:idle:AVERAGE:"Avg \\: %8.2lf" \ GPRINT:idle:MIN:"Min \\: %8.2lf" \ GPRINT:idle:MAX:"Max \\: %8.2lf\\n" \ LINE2:total#000000:"Total" \ GPRINT:total:AVERAGE:"Avg \\: %8.2lf" \ GPRINT:total:MIN:"Min \\: %8.2lf" \ GPRINT:total:MAX:"Max \\: %8.2lf\\n"

snmp-graph.properties

125

Restart
Monitoring an Application: OpenNMS

Requires OpenNMS to restarted due to capsdconguration, poller-conguration, and httpdatacollection-cong changes.


sudo /sbin/service opennms restart

126

Modify Provisioned NMS


Monitoring an Application: OpenNMS

Use the IP of your NMS

Added Required Services


127

Create a KSC Report


Monitoring an Application: OpenNMS

KSC Reports can contain graphs from any resource Use the Report builder to create a report with data from SNMP, JMX, and Apache:
System Swap (Net-SNMP via SNMP Collector) OpenNMS Login Response Time (HTTP Login via Poller) Apache CPU Load (Apache CPU via HTTP Collector) OpenNMS JVM Memory Usage (JVM via JMX Collector) CPU Statistics (Net-SNMP via SNMP Collector)

128

Create a KSC Report


Monitoring an Application: OpenNMS

(cont)

129

A Quick Break
Monitoring an Application: OpenNMS

Take 5 before the lab

130

Lab 1
Monitoring an Application: OpenNMS

Complete the practical exercise in this chapter

131

Lab 2: Extry Credit


Monitoring an Application: OpenNMS

Complete the following congurations


Monitor and eBay Auction http:/ /www.opennms.org/wiki/ HTTP_Collector#eBay_Auction Monitor the Nasdaq, DJIA, and S&P500 Indexes http:/ /www.opennms.org/wiki/ HTTP_Collector#Stock_Prices

132

Break Time
Monitoring an Application: OpenNMS

Take 10 before the next Chapter

133

Chapter 6
Generating Reports

The Pointy-Haired Boss wants the data that OpenNMS produces but wants it to look pretty. Enter database reports.

134

iReport
Database Reports

JasperReports is an open source database reporting tool. The iReport application will allow you to create .jrxml les that can be imported directly into OpenNMS.

135

iReport - starting
Database Reports

136

iReport - adding a DB connection


Database Reports

137

iReport - Choose PostgreSQL


Database Reports

138

iReport - ll in connection details


Database Reports

139

Create a New Report - TopEvents


Database Reports

140

Fields
Database Reports

141

Details
Database Reports

142

Dene Headers
Database Reports

142 143

Add a Chart
Database Reports

142 143 144

Create Variables
Database Reports

142 145

Unique Event Identifier (UEI) uei.opennms.org/nodes/nodeLostService uei.opennms.org/syslogd/auth/Info uei.opennms.org/nodes/nodeRegainedService uei.opennms.org/syslogd/unknown facility='10'/Warning uei.opennms.org/internal/promoteQueueData uei.opennms.org/nodes/nodeDown uei.opennms.org/vendor/powerware/traps/accessViolationHTTP uei.opennms.org/nodes/nodeUp uei.opennms.org/troubleTicket/update uei.opennms.org/nodes/dataCollectionFailed

Count 19569 11212 8740 5129 4182 2235 2118 1490 953 637

dataCollectionFailed update nodeUp accessViolationHTTP nodeDown nodeLostService promoteQueueData

Warning

nodeRegainedService

Info

146

Break Time
Monitoring an Application: OpenNMS

Take 10 before the next Chapter

147

Você também pode gostar