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("Event SourceLocation = " + event.getSourceLocation()); 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)","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