Hi,
This is fine, EventSource is mostly used server side.
On the agent side, the EventManager[1] will create an EventSource instance from your Event instances details before pushing the event report to the server.
Regards, Thomas
[1] https://git.fedorahosted.org/cgit/rhq/rhq.git/tree/modules/core/plugin-conta...
Le 02/04/2013 01:48, Ginny Brown a écrit :
Hi folks,
I am using RHQ 3.0.0 and have an RHQ agent plugin that sends events. When creating a new event, I set all the allowed parameters through the constructor:
import org.rhq.core.domain.event.Event; Event(String type, String sourceLocation, Date timestamp, EventSeverity severity, String detail)
Code sample (all parameters passed in are the expected types):
Event event = new Event(getEventType(), source,
System.currentTimeMillis(), rhqSeverity, jsonString); log.info http://log.info("Event SourceLocation = " + event.getSourceLocation()); log.info http://log.info("Adding Alarm event to set: " + event.toString());
agent.log output:
2013-04-01 19:30:45,076 INFO [EventManager.poller-1] (seachange.monitoring.plugins.SpotAlarms.SpotAlarmsEventPoller)- Event SourceLocation = SECQAMVL.Archive
2013-04-01 19:30:45,076 INFO [EventManager.poller-1] (seachange.monitoring.plugins.SpotAlarms.SpotAlarmsEventPoller)- Adding Alarm event to set: Event[id=0, *source=null*, timestamp=1364859045076, severity=INFO, detail={"uuid":"e810101f-146d-4ba4-a7e1-c32f022ab541","alarmDateTime":"Fri Sep 21 12:34:26 EDT 2012","alarmMessage":"Name Archive Service: restore archived file to MVL completed, ID 1385 ","eventDateTime":"Fri Sep 21 12:34:16 EDT 2012","eventCount":1,"alarmName":"Archive Service: restore archived file to MVL completed","alarmId":1385,"eventType":"Alarm","alarmSeqNumber":2719,"alarmSeverity":"Low","eventParameters":"[MV, TEST-01, SECQAMVL, 12]","eventSource":"Archive","eventComputer":"SECQAMVL","alarmCategory":"Software","eventId":1076494369,"eventSeverity":"Information","pluginSeqNum":"SECQAMVL.111","pluginResource":"SpotAlarms (gbrown-w7.schange.com http://gbrown-w7.schange.com)","alarmSource":"Archive","alarmType":"Trigger"}]
Everything looks fine, except that the event source is null. It looks like I can get/set the sourceLocation, but only get the source. What uses the event source, and does it get set somewhere else? Is there anyway that I can set the source from the plugin?
Thanks! Virginia Brown
rhq-users mailing list rhq-users@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/rhq-users