Hyperic OpenNMS Integration

Integrating OpenNMS with Hyperic

If you’ve tried to get OpenNMS (1.7ish) to consume a Hyperic(4.2.0EE)-produced XML file through provisiond, you’ve probably pulled most of your hair out in the process. This is something both sides claim ‘just works’ but there is a little more involved than is detailed in publicly available documentation.

The problem: The provisiond daemon doesn’t recognize that there is a set of nodes to import in the XML file. This is because there is no XML namespace in the XML produced by the Hyperic groovy web service.

Here is the quick and dirty fix:

# Fixing HQ's bad model export

curl http://ONMSUSER:PASSWORD@hyperic.example.com:7080/hqu/opennms/exporter/list.hqu > /opt/opennms/etc/hq.xml
sed -i 's/model-import foreign-source/model-import xmlns="http:\/\/xmlns.opennms.org\/xsd\/config\/model-import" foreign-source/g' /opt/opennms/etc/hq.xml

Instead of referencing an HTTP URL to pull the XML from in provisiond-configuration.xml, use the local file produced by the script above:

<requisition-def import-name="HQ" import-url-resource="file:///opt/opennms/etc/hq.xml">
   <cron-schedule>0 * * * * ? *</cron-schedule>
</requisition-def>