DX NetOps

  • 1.  Event variables and the REST API

    Posted Aug 16, 2013 04:02 PM
    When using the https://192.168.5.16/spectrum/restful/events and posting an eventrequest with my eventtype and varbinds specified if one of the variables is any other type other than {S #} or {C #} I don't see the specified value appear in the console. For example if the event contains a {I #} variable and I try and pass an integer the value does not appear in the event in the console. Either I am doing something wrong or I am trying to do something that isn't allowed. Should I be able to pass values for variable such as {B #}, {I #}, etc?

    I noticed in the "CA Spectrum Command Line Interface User Guide" for the create event CLI it states "Not all event types include user-entered text. Examples of such event types are those that include the variable {S 0} in their event format files." The create event CLI if I understand correctly only allows a single {S 0} variable passed in. Is this the recommend rule that user created events only have one variable of type string?


  • 2.  RE: Event variables and the REST API

    Posted Nov 20, 2013 07:27 AM

    Hi

    Afraid I don't have an answer for your question but I'm hoping you can help me out :-)

    Can you tell me how you are using the restful API to create events please? I have raised a separate post about this and subsequently found your post ..

    For info I want to do this inside a Perl script and would hope to be able to use curl. There are some examples in the RestfulExamples/xml/Events directory but I haven't been able to figure out how to use these. I have tried variations of the following but always get an error ..

    curl -v -X POST --header 'content-type: application/xml' -d GetCiscoRouterModels.xml --user specadmin:spectrum "http://localhost/spectrum/restful/events"

    Cheers, John



  • 3.  RE: Event variables and the REST API

    Posted Nov 21, 2013 09:59 AM

    I see the same behavior, this might be a limitation of using to create events. Maybe you could write in an EventProcedure to convert the string to type int (e.g. ToUInteger({S 1}) )

    Is there a way to use custom event codes? Everytime I try to use a non-CA default event code I get the following tomcat log output

    Nov 21, 2013 9:34:26 AM (http-bio-443-exec-1100) (RESTFULWEBSERVICES) - (DEBUG) - processing createEventByXML
    Nov 21, 2013 9:34:26 AM (http-bio-443-exec-1100) (RESTFULWEBSERVICES) - (DEBUG) - number of events to create: 1
    user: 
    host: 
    Nov 21, 2013 9:34:26 AM org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper toResponse
    WARNING: WebApplicationException has been caught : no cause is available
     
    Also is there any documentation on using the rest events api? The official REST API doc mentions nothing about the events URL.
     


  • 4.  Re: Event variables and the REST API

    Posted May 09, 2019 01:56 PM

    I am currently trying to create events via the REST interface and I have a need for submitting varbind values as integers.  Trying to use a script to simulate events that would have been received by traps and those traps have varbinds that are integers.  From what I can tell the REST interface only lets me provide string values.

    How can I supply a value that is in integer?



  • 5.  Re: Event variables and the REST API

    Posted May 09, 2019 06:50 PM

    Hi Bill

    The answer I got from support is that currently the varbind can only be a string, nothing else is supported. I was told this is FAD  ... I have been told since that this functionality will be extended to support other variable types but I have no timeline on that. I am off tomorrow but will chase next week and see can I get some info on that.

     

    John