Hi Jim, Ken, All, We just finished doing the same thing (constructing the event message from event format file and the variables) for the same reason (Ticket system). As we did not know about the possibility to get the right format file from OneClick, we used the files itself. But this sounds really interesting. However, is it possible to get the content of the EventTable files the same way? Is this documented somewhere?
Cheers, Joern Joern Henrichs Senior System Engineer Infrastructure Services & Support Computacenter AG & Co oHG Services & Solutions Voltastraße 1, 60486 Frankfurt, Germany Tel.: +49 69 97779 342 Mobile: +49 173 2946155 Fax: +49 69 97779 110 Short-Dial: 22342 E-Mail: [email protected]<mailto:[email protected]> WWW: www.computacenter.de<http://www.computacenter.de/> Von: Pfleger, Jim [mailto:[email protected]] Gesendet: Donnerstag, 10. Februar 2011 16:15 An: spectrum Betreff: Re: [spectrum] Event Message extraction with CORBA Unfortunately, this isn't as straightforward as it ought to be. The first thing you need to do is get a handle for the event domain, which is just like getting the model domain. (Note that the instructions for how to do it in the API Reference PDF are completely wrong.) CORBAHelper helper = CORBAHelper.getHelperImpl(); Properties props = new Properties(); props.setProperty("user.name", username); props.setProperty("CORBAHelper.password", password); helper.init(null, props); CsCEventDomain ed = (CsCEventDomain) helper.getObjectImplementation(CsCEventDomain.class, hostname); I'm assuming that you can already retrieve the alarm you want. When you retrieve the alarm, make sure to request CsCorbaAlarmHelper.EVENT_ID_LIST as one of its attributes. This is the list of all the event IDs associated to this alarm. Once you have that attribute stored in CsCValue value, then value.eventIDList() is a byte[][] - an array of event IDs, which are byte[]. The originating event ID is always the first element. If you want to retrieve all the associated events, replace eventIdList below with value.eventIDList(). Otherwise, the one event you want will be in event at the end of this snippet. byte[][] eventIdList = new byte[][] {value.eventIDList()[0]}; int[] reqAttrs = {CsCorbaEventHelper.TYPE_ATTRIBUTES}; /* This means retrieve all the varbinds */ CsCEventList el = ed.getEventList(eventIdList, reqAttrs); CsCEvent event = el.list[0]; Now that you have the event in a usable format, you can get at all the varbinds. Just like in an alarm, event.attrValList.list contains all the attributes in no particular order. You'll need to iterate through the list, looking at each attribute's attributeID to find the ones you're interested in. For example: for (CsCAttrValue event_attr : event.attrValList.list) { switch (event_attr.attributeID) { case INTERESTING_ATTR: /* Do something with event_attr.value */ break; } } The attribute IDs are the numbers you used in the AlertMap to assign trap varbinds to event attributes. If you want the actual text that OneClick shows (the event format file), this is not available through the CORBA API. However, you can get it from a OneClick server at: http://oneclick:8080/spectrum/event-config/do/eventFormat?format=text&event=69379 The event value is the decimal representation of the event code. The only other format option I've found is "html". One final caveat - if you're relying on retrieving events, note that they're only available from the primary SpectroServer. If you've failed over to the secondary, even though it's storing events, those events are not available through the CORBA API. Please feel free to contact me directly if you have any other questions or issues. HTH, Jim -- JIM PFLEGER | Application Architect | Insight | insight.com t. 480.889.9680 f. 480.889.9599 [email protected] On 2/10/11 5:03 AM, "Kenneth Kirchner" <[email protected]> wrote: > Does anyone know if it is possible to access the event message that is > displayed for an alarm using CORBA? All of the useful info from the trap var > binds are displayed in the event message and I would like to copy that data > into our ticketing system. I do not know which attribute ID would contain > this, if it is even available. > > -Ken > --- > To unsubscribe from spectrum, send email to [email protected] with the body: > unsubscribe spectrum [email protected] * --To unsubscribe from spectrum, send email to [email protected]<mailto:[email protected]> with the body: unsubscribe spectrum [email protected] ----------------------------------- Computacenter AG & Co. oHG, mit Sitz in Kerpen (Amtsgericht Köln HRA 18096) Vertretungsberechtigte Gesellschafter: Computacenter Aktiengesellschaft, mit Sitz in Köln (Amtsgericht Köln HRB 28384) Vorstand: Oliver Tuszik (Vorsitzender), Dr. Karsten Freihube, Hans-Georg Freitag, Frank Kottmann, Reiner Louis Aufsichtsrat: Michael Norris (Vorsitzender) Computacenter Management GmbH, mit Sitz in Köln (Amtsgericht Köln HRB 28284) Geschäftsführer: Ulrich Irnich Visit us on the Internet: http://www.computacenter.de Visit our Online-Shop: https://shop.computacenter.de This email is confidential. If you are not the intended recipient, you must not disclose or use the information contained in it. If you have received this mail in error, please tell us immediately by return email and delete the document. ----------------------------------- --- To unsubscribe from spectrum, send email to [email protected] with the body: unsubscribe spectrum [email protected]
