SPECTRUM Event Procedure for parsing out two varbinds from a single varbind entry

book

Article ID: 52011

calendar_today

Updated On:

Products

CA Spectrum

Issue/Introduction

SPECTRUM Event Procedure for parsing out two varbinds from a single varbind entry

Environment

Release: Any
Component:

Resolution

A user had the following requirement;

From a single varbind from a trap, they want to parse out two new varbinds.

The following is a sample from the trap varbind:

Object:1.3.6.1.4.1.9.9.368.1.15.10.0 Value:Service Transition - Service:bridge202-http State:down

What they would like to do is parse out the Service and the State into two new separate varbinds.

Using the above sample trap varbind, the Service varbind would be "bridge202-http" and the State varbind would be "down".

The following Event Procedure will parse out the required information:

 

0xffff0000 E 50 P " \
  CreateEventWithAttributes( \
    { C CURRENT_MODEL }, \
    { H 0xffff0001 }, \
    SetEventAttribute( \
      SetEventAttribute( \
        GetEventAttributeList(), \
        { U 2 }, \
        GetRegexp( \
          GetEventAttribute( { U 1 } ), \
          { S \"Service: *(.*?) +\" }, \
          { U 1 } )), \
      { U 3 }, \
      GetRegexp( \
        GetEventAttribute( { U 1 } ), \
        { S \"State: *(.*)\" }, \
        { U 1 } )))"

Additional Information

Note: The above Event Procedure assumes varbind 1 is the input varbind and varbinds 2 and 3 are the output varbinds. You may need to change these to your specific needs.

Note: The Event ID's may need to be changed to your specific needs.

Please refer to the "Event Configuration" section of the documentation for more information.