HQU OpenNMS
Integration with OpenNMS
HQ 3.2.2's integration with OpenNMS (version 1.3.10) is done through extending OpenNMS Group's initial integration work with HQ 3.2 through leveraging the HQU Framework. Some of the information found on this page is expanded in much more detail in OpenNMS's white paper on this topic, as well as how to prepare OpenNMS for the integration.
| HQ Open Source Issue There is a bug related to the OpenNMS action tab in HQ Open Source. If you want to use the OpenNMS integration, you will have to replace the following file with this download: hq-engine/server/default/deploy/hq.ear/hq.war/WEB-INF/lib/hq_jsp.jar |
OpenNMS provides an API for synchronizing monitored elements from external monitoring systems. The effort here revolves around the sharing of alert information from HQ to OpenNMS. There are two parts to the integration.
Importing HQ Platforms to OpenNMS Nodes
First of all, a definition of terminology. Hyperic defines a physical or virtual hardware and operating system combination as a Platform, and in OpenNMS it's called a Node. An OpenNMS HQU plugin has been developed and is shipped by default with the 3.2.2 product, which exposes a Web Service that exports Hyperic's platforms as OpenNMS nodes. The web service will require authentication, which can be embedded in the URL itself. You might test it out by using curl:
curl http://hqadmin:hqadmin@localhost:7080/hqu/opennms/exporter/list.hqu
Which then outputs the list of HQ platforms in XML format.
<model-import foreign-source='HQ' date-stamp='2008-03-26T10:40:45.098'> <node node-label='The-Idea-Men' foreign-id='10001'> <interface ip-addr='127.0.0.1' descr='agent-address' status='1' snmp-primary='N'> <monitored-service service-name='ICMP' /> <monitored-service service-name='HypericAgent' /> </interface> </node> </model-import>
|
If you are using HQ Enterprise, you can choose to enable the Guest User account to avoid using the username and password in plain text and allow OpenNMS to access the export data without passing in authentication information. |
On the OpenNMS side, you want to configure model-importer.properties. Adjust the cron schedule for imports to your liking and add the proper URL:
importer.importURL=http://hqadmin:hqadmin@localhost:7080/hqu/opennms/exporter/list.hqu
importer.importSchedule=1 0 0 * * ?
Making these changes will schedule an import from HQ into OpenNMS daily at one second after midnight.
The full plugin can be found here.
Alert OpenNMS Action
To forward alerts generated in HQ to OpenNMS, you have to create an OpenNMS action for the alert definition. To enable the action UI, modify alertdef-prop-service.xml in HQ. Look for actions and add the OpenNMS action class.
actions = \ org.hyperic.hq.bizapp.server.action.email.EmailAction, \ org.hyperic.hq.bizapp.server.action.integrate.OpenNMSAction
Restart your HQ server. You should now see an additional OpenNMS notification tab when you view Alert Definitions.

By setting the proper OpenNMS host and port parameters, the OpenSMS action will forward the alert and all the alert details to OpenNMS to the specified server.
|
If you are using HQ Enterprise, you can set the OpenNMS action on Resource Type Alerts and the OpenNMS action will apply to all resources of the specified type. |
To make any changes to the OpenNMS SNMP trap, you can directly manipulate hq-engine/server/default/deploy/hq.ear/alertTemplates/opennms_notify.gsp and it will be in effect without requiring a server restart.