Integrating with OpenNMS
OpenNMS is designed to be a framework, and thus integration with other products is encouraged, even products published under a proprietary license. There are a number of ways to integrate with OpenNMS using either configuration files, wire protocols or custom code, and they are summarized below.
Note: This is not to serve as legal advice. Any questions about using OpenNMS outside of the GPL should be addressed to a knowledgeable expert.
- 1 What To Do
- 2 What Not To Do
What To Do
If a device or application supports a protocol that OpenNMS can use, such as SNMP, integration is a simple as adding the proper information to a configuration file. Adding data collection groups to datacollection-config.xml and reports to snmp-graph.properties will cause that data to be automatically collected and graphed. It can then be used to trigger threshold events and notifications.
OpenNMS also includes a General Purpose Monitor which will execute programs outside of OpenNMS, parse the return codes and messages, and use that to determine if a resource is "up" or "down".
Getting Information In
The OpenNMS event daemon, eventd, listens on port 5817. It is possible to send text in the form of XML objects and cause OpenNMS to interpret it as an event. That event can be used in alarms as well as notifications. The send-event.pl script in the OpenNMS bin directory is an example of how easy it is to send information to OpenNMS, and should be adaptable to almost any programming language that can connect to a TCP socket. The send-event.pl script is used quite often to send information to OpenNMS from other programs and scripts, such as a nightly backup job.
Many applications support sending SNMP traps. OpenNMS can receive SNMPv1 traps and SNMPv2c traps and informs via its Trapd listener on the standard port 162/udp. Traps are turned into OpenNMS events according to XML-formatted configuration rules in the eventconf.xml file and other files included from there.
TL1 Autonomous Events
Many high-end telecom and networking devices support TL1 (Transaction Language 1) as a management mechanism. OpenNMS can receive autonomous messages via TL1, turning them into OpenNMS events which can then be forwarded as XML or SNMP traps. See TL1 Support in OpenNMS for details.
JDBC Data Sources
OpenNMS can use any JDBC-compatible data source for alarm enrichment or other purposes. These data sources are configured in the opennms-datasources.xml' file.
The OpenNMS Model Importer allows nodes, interfaces, services, and categories to be defined in an XML file and imported on a cron-like schedule. This powerful facility is the preferred way to use an external provisioning system as the "source of truth" for some or all of OpenNMS' managed footprint.
The OpenNMS Collector can be augmented to support new and different management protocols thus allowing the importation of management information outside of SNMP. See Creating_a_Collector for more information.
Getting Information Out
There are a number of ways to get information back out of OpenNMS. In the case of data collection, it is possible to use the RRDtool or JRobin formatted files outside of OpenNMS. A lot of information is written to the database as well, and can be queried using ODBC or JDBC.
In addition, you can get event information out of OpenNMS directly by using Scriptd. Scriptd allows one to create scripts that act on OpenNMS events to execute arbitrary script code (implemented via a configuration file). Using Scriptd one can do almost anything imaginable that can be accomplished with Java objects, including sending SNMP traps to external management systems.
Since OpenNMS is published under the GPL, any changes to the OpenNMS code must also be distributed under the GPL. It is possible to architect integration solutions that implement, say, a wire protocol, where only the part that talks directly to OpenNMS would need to be included under the GPL.
OpenNMS is also starting to provide APIs, such as the Trouble Ticketing API, which enables integration with CentricCRM and Jira, and others coming soon.
What Not To Do
Tightly Package OpenNMS with a Proprietary Program
The GPL FAQ covers this pretty well. Since the idea is to insure that people are aware of their rights under the GPL when using OpenNMS, it is important that there is a clear difference between OpenNMS and the other programs being distributed.
Use OpenNMS Code in Java "import" Statements
The Java import statement tells the java compiler where to look for class definitions. While the compilation mechanism is different between Java, and say, C, the result is the same - any code that imports OpenNMS classes is creating a derivative work under the GPL, and the resultant code must be licensed under the GPL.
When Sun published the Java JDK under the GPL, they added what is known as the "Classpath Exception". This allows for Java class definitions to be used in proprietary products. Without this exception, all Java code built with the GPL'd JDK would have to be published under the GPL. OpenNMS has no such exception.