VMware Cloud Community
sohanraja
Contributor
Contributor

directing alerts of hyperic to opennms

I am using hyperic 4.0.1 integration with opennms 1.6.1 I am not able to redirect alerts to opennms.

Please guide.
0 Kudos
20 Replies
staceyeschneide
Hot Shot
Hot Shot

Hi Sohanraja,

Glad to see you are trying out this interface. There are a couple resources available for you to help you along.

Whitepaper: http://www.opennms.org/images/3/3a/Hyperic-integration3.pdf
Webinar: http://download.hyperic.com/swf/HyperCAST10/playback.html

Good luck,
-Stacey
0 Kudos
sohanraja
Contributor
Contributor

thanks for replying, i have setup the things as shown in pdf link, now it when hq send alert to opennms@<host> i have got several errors. like
2008-12-23 11:50:27,342 WARN [Thread-20] [org.hyperic.hq.bizapp.server.action.email.EmailAction@100] Unable to render template
org.hyperic.hq.common.SystemException: groovy.lang.MissingPropertyException: No such property: address for class: java.util.HashMap$Entry


i have attached the full error log.

please guide me how can i configure it in a right way.
0 Kudos
dhustace
Contributor
Contributor

The Hyperic engineers improved the changes we submitted and have these instructions to follow. I will attempt to get our docs updated as well.

http://support.hyperic.com/display/hypcomm/HQU+OpenNMS

David Hustace
The OpenNMS Group, Inc.
0 Kudos
dhustace
Contributor
Contributor


On Dec 23, 2008, at 1:27 AM, sohan wrote:

> thanks for replying, i have setup the things as shown in pdf link,
> now it when hq send alert to opennms@<host> i have got several errors.

You're not smellin what I'm steppin in! (You didn't understand my
previous reply). Follow the instructions in this link. Do not follow
the installation instructions from the PDF.

http://support.hyperic.com/display/hypcomm/HQU+OpenNMS



David Hustace
The OpenNMS Group, Inc.


0 Kudos
TomV_hyperic
Contributor
Contributor

We are testing using seperate servers for Hyperic and OpenNMS.

How do I get OpenNMS to listen on it's real IP as well as it's loopback IP?

The Hyperic machine is unable to telnet to the OpenNMS machine.
"telnet 1.2.3.4 5817" fails.

From the OpenNMS machine, "telnet 1.2.3.4 5817" also fails, but "telnet localhost 5817" works.

If I change the TCPAddress and UPDAddress in eventd-configuration.xml to specify OpenNMS's real IP (1.2.3.4), I am able to reach it from other machines, but OpenNMS doesn't gather any data.

What is the correct way to do what I'm trying to do.

thanks,
tom
0 Kudos
dhustace
Contributor
Contributor


On Jan 2, 2009, at 4:20 PM, Tom wrote:

> We are testing using seperate servers for Hyperic and OpenNMS.
>
> How do I get OpenNMS to listen on it's real IP as well as it's
> loopback IP?

I assume you mean listen the TCP Event Proxy. It binds to 127.0.0.1
only by default. Change it in eventd-configuration.xml. Change the
TCP and UDP proxy ports to required IP. You can also set it to, * for
all interfaces.


David Hustace
The OpenNMS Group, Inc.


0 Kudos
TomV_hyperic
Contributor
Contributor

I now can see eventd.log is receiving events sent from Hyperic.

However, I followed the steps from the PDF before I found this thread with updated instructions.

I don't know if it is related, but in eventd.log, I am seeing the error below..

I am evaluating Hyperic HQ Version 4.0.2-EE
with OpenNMS 1.6.1-1

thanks,
tom
--------------------------------------------------------------------------------------------------

2009-01-05 11:45:38,858 ERROR [Event TCP Receiver[5817][<IP Of Hyperic Server>:52197]] TcpStreamHandler: Could not unmarshall the XML record: org.exolab.castor.xml.MarshalException: XML document structures must start and end within the same entity.{File: [not available]; line: 131; column: 57}
org.exolab.castor.xml.MarshalException: XML document structures must start and end within the same entity.{File: [not available]; line: 131; column: 57}
at org.exolab.castor.xml.Unmarshaller.convertSAXExceptionToMarshalException(Unmarshaller.java:755)
at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:721)
at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:610)
at org.opennms.netmgt.dao.castor.CastorUtils.unmarshal(CastorUtils.java:117)
at org.opennms.netmgt.eventd.adaptors.tcp.TcpStreamHandler.run(TcpStreamHandler.java:268)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.xml.sax.SAXParseException: XML document structures must start and end within the same entity.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.skipChar(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:709)
... 4 more
Caused by: org.xml.sax.SAXParseException: XML document structures must start and end within the same entity.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.skipChar(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:709)
at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:610)
at org.opennms.netmgt.dao.castor.CastorUtils.unmarshal(CastorUtils.java:117)
at org.opennms.netmgt.eventd.adaptors.tcp.TcpStreamHandler.run(TcpStreamHandler.java:268)
at java.lang.Thread.run(Thread.java:619)
0 Kudos
TomV_hyperic
Contributor
Contributor

I removed all traces of OpenNMS from the OpenNMS server and reinstalled it following the instructions mentioned above.

I still get the error listed in my previous post.

Any pointers?

thanks
tom
0 Kudos
admin
Immortal
Immortal



On Jan 5, 2009, at 12:02 PM, Tom wrote:

I am evaluating Hyperic HQ Version 4.0.2-EE
with OpenNMS 1.6.1-1

Tom, we've not changed the marshaling schema for the XML event proxy so my first guess is that something changed on the hyperic side that isn't properly formatting the XML.

I would stop opennms and capture the XML being sent from Hyperic on TCP/5817 with a utility like netcat.

nc -l <ipaddress> 5817



David Hustace
The OpenNMS Group, Inc.


0 Kudos
TomV_hyperic
Contributor
Contributor

I ran the nc command and noticed some odd behavior.

I ran it a few times and piped the results to a file. I noticed that it didn't seem to have a proper end...

when the event is sent, the machine running nc sees the following:
-------------------
<log>
<events>
<event>
<uei>uei.opennms.org/external/hyperic/alert</uei>
<source>HQ</source>
<time>Tue Jan 06 15:05:28 EST 2009</time>
.
.
.
.
<parm>
<parmName>resource.url</parmName>
<value><hyperic server IP:7080/Resource.do?eid=2:10072</value>
</parm>
<parm>
<parmName>resource.resourceType.cid</parmName>[
-------------------
That's it.. no </log>, no </events> etc

I passed it off as my SSH session dying due to network issues since I walked away while it was running.

However, I ran it again and noticed that the nc command was actually shutting down every time the event was received. Every time it runs, nc dies at the same point.

I reinstalled OpenNMS to ensure the steps from the PDF weren't causing problems, but I haven't reinstalled Hyperic.

Would a step from the PDF create this issue? If so, how can I remove the changes without reinstalling Hyperic.

thanks,
tom
0 Kudos
admin
Immortal
Immortal



On Jan 6, 2009, at 4:13 PM, Tom wrote:

However, I ran it again and noticed that the nc command was actually shutting down every time the event was received.  Every time it runs, nc dies at the same point.

That's netcat behavior.


I reinstalled OpenNMS to ensure the steps from the PDF weren't causing problems, but I haven't reinstalled Hyperic.

You're not getting the entire event form Hyperic, for some reason.  It seems broke.  There was no need to reinstall OpenNMS since NC is showing you what you needed to know and took OpenNMS out of the equation.  An incomplete event is being sent from Hyperic.  I would go back to a Hyperic version that we know works just to verify, version 3.2.6 perhaps.  Maybe it is not Hyperic and something in the network or systems configuration that is chopping of the event... but that seems unlikely.

I don't have access to Hyperic HQ Enterprise source but I assume that plugin behavior is the same as the open source version.  If you have success with 3.2.6, that would be interesting to here for I have not installed the integration with version 4.



Would a step from the PDF create this issue?  If so, how can I remove the changes without reinstalling Hyperic.

Doubtful, since you seem to have all the configuration correct enough to be getting Event messages to the OpenNMS server.


David Hustace
The OpenNMS Group, Inc.


0 Kudos
admin
Immortal
Immortal


David,

OpenNMSAction is open-source: org.hyperic.hq.bizapp.server.action.integrate.OpenNMSAction.  Nothing has been changed since we did the integration.

Charles


0 Kudos
dhustace
Contributor
Contributor



On Jan 7, 2009, at 1:07 PM, Charles Lee wrote:

OpenNMSAction is open-source: org.hyperic.hq.bizapp.server.action.integrate.OpenNMSAction.  Nothing has been changed since we did the integration.

Okay, Charles.  I will test it later this week.


Thanks,

David Hustace
The OpenNMS Group, Inc.

p.s. Happy New Year to you and Hyperic.

0 Kudos
ama_hyperic
Hot Shot
Hot Shot

Comment out CID in: hq-engine/server/default/deploy/hq.ear/alertTemplates/opennms_notify.gsp

/*
parm {
parmName("resource.resourceType.cid")
value("${resource.resourceType.cid}")
}
*/


Looks like CID does not exist in 4.0 which is causing the XML Renderer to spit up everything until CID and then stop which explains the malformed XML.
0 Kudos
admin
Immortal
Immortal



On Jan 8, 2009, at 5:53 PM, Alex Ma wrote:

Looks like CID does not exist in 4.0 which is causing the XML Renderer to spit up everything until CID and then stop which explains the malformed XML.

Heh.  Good catch Alex!  I'd report a bug if I were you.

David Hustace
The OpenNMS Group, Inc.


0 Kudos
dhustace
Contributor
Contributor



On Jan 8, 2009, at 5:53 PM, Alex Ma wrote:

Looks like CID does not exist in 4.0 which is causing the XML Renderer to spit up everything until CID and then stop which explains the malformed XML.

Alex,

Just FYI, I checked and the event translation and event display formatting configuration for this integration doesn't require that parameter.  So, it should still behave correctly.

I would like it you kept us updated (or me personally) on your experience with this integration.

Thanks,

David Hustace
The OpenNMS Group, Inc.
david@opennms.org


0 Kudos
pinponpum
Contributor
Contributor

Check too file "alertdef-prop-service.xml" which by default has this content:

triggers = \
org.hyperic.hq.bizapp.server.trigger.conditional.MeasurementThresholdTrigger, \
org.hyperic.hq.bizapp.server.trigger.conditional.ControlEventTrigger, \
org.hyperic.hq.bizapp.server.trigger.conditional.ValueChangeTrigger, \
org.hyperic.hq.bizapp.server.trigger.conditional.AlertTrigger, \
org.hyperic.hq.bizapp.server.trigger.conditional.CustomPropertyTrigger, \
org.hyperic.hq.bizapp.server.trigger.conditional.LogEventTrigger \
org.hyperic.hq.bizapp.server.trigger.conditional.ConfigChangedTrigger

But I think you need to put a comma in "LogEventTrigger" line:

triggers = \
org.hyperic.hq.bizapp.server.trigger.conditional.MeasurementThresholdTrigger, \
org.hyperic.hq.bizapp.server.trigger.conditional.ControlEventTrigger, \
org.hyperic.hq.bizapp.server.trigger.conditional.ValueChangeTrigger, \
org.hyperic.hq.bizapp.server.trigger.conditional.AlertTrigger, \
org.hyperic.hq.bizapp.server.trigger.conditional.CustomPropertyTrigger, \
org.hyperic.hq.bizapp.server.trigger.conditional.LogEventTrigger, \
org.hyperic.hq.bizapp.server.trigger.conditional.ConfigChangedTrigger



With that and all other things in this post I get alarms working again from Hyperic to OpenNMS.

Thank you everyone 🙂
0 Kudos
TomV_hyperic
Contributor
Contributor

Thanks for the fix..

While tailing eventd.log, I noticed a new error related to converting the time.. I don't know what this affects, but I'd figure I'd at least point it out.

--------------------------------------------------------

2009-01-09 09:16:07,760 WARN [EventHandlerPool-fiber4] JdbcEventWriter: Failed to convert time Fri Jan 09 09:16:07 EST 2009 to Timestamp, setting current time instead. Exception: java.text.ParseException: Unparseable date: "Fri Jan 09 09:16:07 EST 2009"
java.text.ParseException: Unparseable date: "Fri Jan 09 09:16:07 EST 2009"
at java.text.DateFormat.parse(DateFormat.java:337)
at org.opennms.netmgt.EventConstants.parseToDate(EventConstants.java:896)
at org.opennms.netmgt.eventd.processor.AbstractJdbcPersister.getEventTime(AbstractJdbcPersister.java:274)
at org.opennms.netmgt.eventd.processor.JdbcEventWriter.insertEvent(JdbcEventWriter.java:191)
at org.opennms.netmgt.eventd.processor.JdbcEventWriter.process(JdbcEventWriter.java:117)
at org.opennms.netmgt.eventd.DefaultEventHandlerImpl$EventHandlerRunnable.run(DefaultEventHandlerImpl.java:134)
at org.opennms.core.concurrent.RunnableConsumerThreadPool$FiberThreadImpl.run(RunnableConsumerThreadPool.java:422)
at java.lang.Thread.run(Thread.java:619)
2009-01-09 09:16:08,316 WARN [EventHandlerPool-fiber4] JdbcAlarmWriter: Failed to convert time Fri Jan 09 09:16:07 EST 2009 to Timestamp, setting current time instead. Exception: java.text.ParseException: Unparseable date: "Fri Jan 09 09:16:07 EST 2009"
java.text.ParseException: Unparseable date: "Fri Jan 09 09:16:07 EST 2009"
at java.text.DateFormat.parse(DateFormat.java:337)
0 Kudos
ama_hyperic
Hot Shot
Hot Shot

Yes, I saw that same message even after syncing the time between HQ Server and OpenNMS server. Dave, does OpenNMS expect a epoch timestamp?
0 Kudos