DX NetOps

Expand all | Collapse all

Can I use data in a varbind to lookup additional data in a table or external system?

Jump to Best Answer
  • 1.  Can I use data in a varbind to lookup additional data in a table or external system?

    Posted 05-03-2018 11:35 AM

    I have a trap from a device that executes some performance testing. One of the varbinds contains an ID that I'd like to use to lookup the name of the device that is on the other end of the circuit being tested. I've used event procedures and regular expressions in the past to construct dynamic alarm titles, so I'm sure I can pull out the ID from the varbind, but can I then use that ID to lookup the device name? Or is there a better way to approach this?



  • 2.  Re: Can I use data in a varbind to lookup additional data in a table or external system?

    Posted 05-18-2018 10:43 AM

    What information is in this varbind ID? If that information is contained within an attribute of a model in the database you may be able to use the GetElement event procedure parameter.

     

    Joe



  • 3.  Re: Can I use data in a varbind to lookup additional data in a table or external system?

    Posted 05-23-2018 09:19 AM

    Unfortunately the data is not an attribute of any model. I'm currently trying to use an Event Table to do the lookup, but that isn't working either. The varbind is a decimal value. I've tried using an Event Table with both decimal and hex values with no success. I've got a case open with support currently.



  • 4.  Re: Can I use data in a varbind to lookup additional data in a table or external system?
    Best Answer

    Posted 06-11-2018 02:18 PM

    Working with support we determined that the issue is that the varbind was a string type, where the lookup value needs to be an integer. Since I can't change the varbind type an event procedure to modify the value to an integer did the trick.

     

    My test trap has the string CFM.Service030911.1249.Network-1-2.down.1249 in the varbind. The following event procedure returns the value 30911 as an integer and successfully does the table lookup using { T TableName 10}.

     

    0xfff01113 E 20 P "CreateEventWithVariables( \

       { C CURRENT_MODEL }, \

       { H 0xfff01114 }, \

       SetEventVariable( \

          GetEventVariableList(), \

          { I 10 }, \

             ToUInteger( \

                GetRegexp( \

                   ToString( \

                      {v 10} \

                   ), \

                   {S\"^CFM.Service([0-9]*)\..*\"}, \

                   {U 1} \

                ) \

             ) \

          ) \

       )"