Title: The Problem with Enterprise Management
1The Problem withEnterprise Management
- Most environments are unique enough to mandate at
least minor customizations.
- Infrastructure technologies iterate too rapidly
to allow for management constancy.
- Networks are always in flux.
- Systems are always in flux.
- Applications are always in flux.
- You typically end up with a clusterflux.
2Along comes OpenNMS
- A network/systems management platform
- SLO/SLA-based monitoring
- Network node and service discovery
- Ongoing polling for availability at the IP level,
the application level, or both. - Open source Licensed under the GPL/LGPL
- Source code available today
- 7x24x365 support available 2Q01 ()
3First Release Functionality
- Automatically discover devices connected to the
network - Rule-based configuration
- Supports multiple user views
- Extremely configurable and customizable
- User-centric service polling
- Leverages multiple open source tools and
technologies - "Testdrive" Release later this week.
4OpenNMS' Real-Time Console
5The OpenNMS Event Browser
6OpenNMS' GraphicalRule Builder
7The OpenNMS Architecture
8Why Java? Why XML?
- Network Management is inherently inefficient in
processor usage. - Ease of development
- Java is platform-independent code XML is
platform-independent data - Good tools available for using XML w/ Java
- Maturing Standards, implementations, JDKs
9The Nuts Bolts
- Started with Sun's JDK 1.2.2 on NT
- Migrated to IBM's JDK 1.3 on Linux and NT
- JDK 1.2.2 has GUI problems on Linux
- JDK 1.3 is not perfect, but it's better
- Sun, with Solaris, is somewhat "unmotivated" to
build reliable, good performing JDKs for Linux
10Defining the Terms
- XML
- XSL
- DTDs
- Parsing
- SAX/DOM
- JAXP
- JDOM
11XML
- eXtensible Markup Language
- Standard proposed by the W3C
- Simplified form of SGML
- Tag-based Markup
- Inefficient, but extraordinarily generic
- Self-documenting
- de Facto standard for e-Commerce data
12XSL
- eXtensible Stylesheet Language
- Dictates how data from an XML document is
formatted and displayed - XML is content, XSL is formatting
- Through this separation, a one-to-many
relationship can be derived
13An XML Example
lt?xml version"1.0" standalone"no"gt lt!DOCTYPE
OpenNMSProjects SYSTEM "projects.dtd"gt lt!--The
beginning of the XML datagt ltOpenNMSProjects
xmlnsOpenNMS'http//www.opennms.org/'gt
ltOpenNMSProjectgtBluebirdlt/OpenNMSProjectgt
ltOpenNMSManagergtShane O.lt/OpenNMSManagergt lt/Open
NMSProjectsgt
14Rules? Rules? We don't need no stinkin' rules!
Or perhaps we do...
15Document Type Definition
- In order to define just what you were thinking
when you created the XML doc. - Defines valid elements, attributes and other
data, including how they are inter-related - Since XML is wide-open and only requires that it
be well-formed, this helps you to constrain the
data.
16A Sample DTD
lt!--DTD for Sample Documentgt lt!ELEMENT
OpenNMSProjects (OpenNMSProject,
OpenNMSManager, OpenNMSAge?)gt lt!ELEMENT
OpenNMSProject (PCDATA)gt lt!ELEMENT
OpenNMSManager (PCDATA)gt lt!ELEMENT OpenNMSAge
(PCDATA)gt
17Something you should have noticed...
- Our declaration of valid data is (PCDATA)
- This is "parsed character data"
- Any character data that is not an element
- What about integers/floats/etc?
- All data in an XML document is characters
- Data typing is up to the application.
18Using XML in Java
- The OpenNMS Example
- XML is pervasive throughout the product
- Configuration files
- Internal "events"
- Distributed transactions
- Each XML has different requirements
- Read/Write/Persistent/Transient/etc.
19Different Toolsfor Different Needs
- Parsing Reading through a document and making
the data usable - The Apache Project's Xerces
- Provides multiple "parsers"
- Supports Java/C/Perl
- Two Approaches to Parsing XML
- SAX DOM
20Simple API for XML (SAX)
- An event-based framework for parsing XML
- SAX provides methods to read in a document and
defines events that are generated under certain
XML conditions - If you implement the org.xml.sax.ContentHandler
interface, you can access methods such as
startElement() and endDocument() - Similar to other event interfaces (e.g.,
ActionListener)
21SAX Parsers
- Technically, SAX is a framework, not a parser
- Some good available parsers include
- Apache's Xerces (http//xml.apache.org)
- Oracle XML Parser
- Sun's Project X
- IBM's XML4J
22Document Object Model (DOM)
- SAX provides access to the data DOM provides the
ability to manipulate the data. - DOM provides a tree representation of an XML
document - Data from the XML document becomes "nodes" in the
DOM tree - Tree traversal is universal across programming
languages
23Comparing SAX DOM
- DOM is much easier to work with.
- The DOM tree is in memory and you can navigate it
and manipulate node data easily - SAX has no concept of upcoming data, and no
memory of past data (unless implemented
programmatically) - So why not ALWAYS use DOM?
24SAX vs. DOM
- Because SAX is event-based, it is much easier on
system resources - Because the DOM tree is created memory-resident,
large documents can be quite burdensome - SAX can be coerced into doing data manipulation.
25A Third Tool
- Sun's Java API for XML Parsing (JAXP)
- Provides a layer of abstraction between the code
and the specific parser chosen - Does not compete with or replace either SAX or
DOM - Conforms to both SAX and DOM specifications
26OpenNMS XML
Where do the pieces fit?
27The OpenNMS Architecture
28Events
- "Traps" come from network devices
- Morphed into an XML event
29Events
- SAX is the answer for event parsing
- Transient
- High Volume
30Event Configuration
- Mapping of events to actions and behavior
- .conf file
- File is XML
31Event Configuration
- DOM is the right answer
- Mapping needs to happen fast
- Repetitive
32Distributed Transactions
- Both event and node info need to be shared
- Different purposes
- "Filters"
33Distributed Transactions
- SAX for Events
- DOM for Nodes
- Constant use of "rules"
- SOAP
34Simple Object Access Protocol (SOAP)
- Microsoft/HP/IBM Standard
- Provides an XML format for distributed
transactions - Supports RPC-like transactions
- IBM's SOAP4J
- Became Apache's SOAP
- Too early to tell on wide-spread adoption
35Wrapping it all up...
- Good tools are available
- The tools (and standards) are maturing
- Java XML were meant for each other
- OpenNMS is a big project that needs to leverage
existing tools. - Java XML by Brett McLaughlin (O'Reilly)
- http//xml.apache.org
- http//www.opennms.org
36Code Sources
- Strategically, it's all Java/XML
- http//xml.apache.org
- Xerces (XML parsers)
- Xalan (XSLT engine)
- Cocoon (XSLFO to PDF generator)
- SOAP (Distributed XML-based transactions)
- http//www.gnu.org/software/java/java.html
- gnu.getopt (Command line parameter parsing
library) - gnu.regex (Regular expression library)
- Multiple projects used as example code
37Code Sources
- And we needed some "standard" tools from the
C/C world - Replacing "yacc" Java Cup
- http//www.cs.princeton.edu/appel/modern/java/CUP
/ - Replacing "lex" jLex
- http//www.cs.princeton.edu/appel/modern/java/JLe
x/ - Replacing "gcc" IBM's Java Development Kit
- http//www.ibm.com/java/jdk
- Replacing an interprocess messenger JSDT
- http//java.sun.com/products/jsdt
38Code Sources
- As well as some other basic tools...
- From Exolab (http//www.exolab.org)
- Castor (for XML-to-SQL data mappings)
- OpenJMS (for an open source Java Messaging
Service) - From Sun (http//java.sun.com)
- Sun's JDK (for early development)
- Sun's JDBC (for database access)
- From IBM
- IBM's XML4J (precursor to Apache's SOAP)
39Code Sources
- There are also external tools, both open and
closed, we need to work with... - PostgreSQL (Open Source Relational Database)
- http//www.pgsql.org
- Oracle (Commercial Database)
- http//www.oracle.com
- CVS (Code control system)
- http//www.cvshome.org
- jEdit (Text editor for development)
- http//freshmeat.net/projects/jedit/