DX NetOps

 View Only
  • 1.  Event Disp, IP filter

    Posted Oct 24, 2014 12:47 PM

    Hi, I have a problem.

     

    I try create a event with this sintaxys

     

    0x05020711 P " CreateEventWithVariables( GetElement( GetModelsByAttrValue ( { H 0x12d7f },\

    Append ( {S \"\"}, GetEventVariable ({U 2}) )),{U 1} ),{ H 0x05020713 },\

    GetEventVariableList( { C CURRENT_EVENT } ) )"

     

    H 0x12d7f is attribute network

     

    but this don´t work!

     

    The trap is:

     

    snmptrap -v 2c -c Comunidad 172.20.3.160 '' NAGIOS-NOTIFY-MIB::nSvcEvent nSvcHostname s "10.100.0.13" nSvcDesc s "SERVICIO" nSvcStateID i 1 nSvcOutput s "TEXTODETALLES"

     

    can you help me?

     

    thanks, regards!



  • 2.  Re: Event Disp, IP filter

    Posted Oct 25, 2014 04:01 AM

    Did you enable the debug in .vnmrc to see what's going wrong here?



  • 3.  Re: Event Disp, IP filter

    Posted Oct 25, 2014 04:02 AM

    You can also trying the event rules by copying all or some of the event variables from one event to other event.



  • 4.  Re: Event Disp, IP filter

    Broadcom Employee
    Posted Oct 25, 2014 02:59 PM

    Hi Mgvergelin,

     

    The syntax of your Event Procedure is not correct.

    • The CreateEventWithVariables procedure requires three parameters (Model Handel, Event Code, and Event Variable List)
    • The GetElement procedure requires two parameters
    • The GetModelsByAttrValue procedure requires two parameters

     

    What is the goal of your event procedure?

     

     

    Here an example of Event Procedure:

     

    0x220011 P " \ --> Default BGP Transition Alarm , P stands for starting of the even Procedure

    CreateEventWithVariables( \ --> Create an event including event variables

    { C CURRENT_MODEL }, \ --> on the current model 

    { H 0xfff00000 },\ --> new event code to be created from the default event

    SetEventVariable(\ --> Set an event variable value in a event variable list

    GetEventVariableList(),\ --> Get a copy of the current event's variable list

    { H 0x00012b4c },\ --> Dynamic alarm title attribute

    Append( \ --> Append text message into the alarm title attribute

    { S \"BGP backward transition. Peer router: \" },\ --> String "BGP backward transition. Peer router: "

    GetEventVariable( { U 5 } ))))" --> Get the value of the variable "5" (IP Address) to be appended to text message

     

    For additional information about the example, please take a look a the following document:

    TEC586756

    Title:  Dynamic Alarm Title Configuration for Border Gateway Protocol (BGP) Alarms

    https://support.ca.com/irj/portal/kbtech?docid=586756

     

     

    CreateEventWithVariables

    Procedure

    Usage

    CreateEventWithVariables

    Create an event including event variables.

    Parameters

    Position

    Type

    Description

    1

    ModelHandle

    The model handle of the model for which to create the event.

    2

    Any Number type

    The event code.

    3

    Event Variable List

    A list containing the variable values for the event.

    Return Value

    Return Type

    Description

    Boolean value

    TRUE if event could be created, FALSE otherwise.

     

     

     

    GetElement

    Procedure

    Usage

    GetElement

    Return the value of an element in a list.

    Parameters

    Position

    Type

    Description

    1

    Any list type

    List to get element from.

    2

    Number type

    Index of desired element in list, starting with 1 for the first element.

    Return Value

    Return Type

    Description

    Any type

    The specified list element, if one exists for the given index.

     

     

    GetModelsByAttrValue

    Procedure

    Usage

    GetModelsByAttrValue

    Find all models which have a given attribute value.

    Parameters

    Position

    Type

    Description

    1

    Unsigned Integer

    Attribute ID.

    2

    Attribute Value

    An attribute value. All models which have their attribute with the id given in
    parameter 1 set to this value will be included in the return value list.

    Return Value

    Return Type

    Description

    List of ModelHandles

    A list of all models matching the search criteria.

     

     

     

    SetEventVariable

    Procedure

    Usage

    SetEventVariable

    Set an event variable value in an event variable list.

    Parameters

    Position

    Type

    Description

    1

    Event Variable List

    An event variable list where the new value should be added (or changed).

    2

    Unsigned Integer

    Event variable id.

    3

    Attribute Value

    Attribute value for new event variable.

    Return Value

    Return Type

    Description

    Event Variable List type

    Passed in event variable list with new variable value set.

     

     

    GetEventVariableList

    Procedure

    Usage

    GetEventVariableList

    Get a copy of the current event's variable list.
    The current event must be set in the environment.

    Parameters

    NONE

    Return Value

    Return Type

    Description

    Event Variable List

    A copy of the current event's variable list, if both the event and the variable exist.

     

     

    GetEventVariable

    Procedure

    Usage

    GetEventVariable

    Get the value of an event variable. The current event must be set in the environment.

    Parameters

    Position

    Type

    Description

    1

    Number type

    Event variable id.

    Return Value

    Return Type

    Description

    Any Attribute Value type

    Event variable value.

     

     

    Append

    Procedure

    Usage

    Append

    Concatenate two strings, appending the second to the first.

    Parameters

    Position

    Type

    Description

    1

    String

    Starting String.

    2

    String

    String to be appended to the first parameter string.

    Return Value

    Return Type

    Description

    String value

    A string resulting form the second string appended to the first.

     

     

    Thanks,

    Silvio



  • 5.  Re: Event Disp, IP filter

    Broadcom Employee
    Posted Oct 26, 2014 08:43 AM

    Based on the snmptrap syntax you have provided, the value of { U 2 } variable is not there, which also causes problem to the event procedure.

    The nHostname.nHostEventIndex is the  { U 2 } variable. The nSvcDesc.nSvcEventIndex is the { U 5 } variable.

     

    I have compiled the NAGIOS-NOTIFY-MIB file into Spectrum and here what I got:

     

    This is the Event Message:

     

    A "nSvcEvent" event has occurred, from {t} device, named {m}.

     

    The SNMP trap that is generated as a result of an event with the service in Nagios.

     

    nHostname = {S 1}

    nHostname.nHostEventIndex = {o 2}

    nHostStateID = {T nHostStateID 3}

    nSvcDesc = {S 4}

    nSvcDesc.nSvcEventIndex = {o 5}

    nSvcStateID = {T nSvcStateID 6}

    nSvcAttempt = {I 7}

    nSvcDurationSec = {I 8}

    nSvcGroupName = {S 9}

    nSvcLastCheck = {I 10}

    nSvcLastChange = {I 11}

    nSvcOutput = {S 12}

     

     

    This is the $SPECROOT/custom/Events/AlertMap file:

     

    1.3.6.1.4.1.20006.1.6.7      0xfff00000 1.3.6.1.4.1.20006.1.1.1.2(1,2)\

                                            # nHostStateID

                                            1.3.6.1.4.1.20006.1.1.1.4(3,0)\

                                            # nSvcDesc

                                            1.3.6.1.4.1.20006.1.3.1.6(4,5)\

                                            # nSvcStateID

                                            1.3.6.1.4.1.20006.1.3.1.7(6,0)\

                                            # nSvcAttempt

                                            1.3.6.1.4.1.20006.1.3.1.8(7,0)\

                                            # nSvcDurationSec

                                            1.3.6.1.4.1.20006.1.3.1.9(8,0)\

                                            # nSvcGroupName

                                            1.3.6.1.4.1.20006.1.3.1.10(9,0)\

                                            # nSvcLastCheck

                                            1.3.6.1.4.1.20006.1.3.1.11(10,0)\

                                            # nSvcLastChange

                                            1.3.6.1.4.1.20006.1.3.1.12(11,0)\

                                            # nSvcOutput

                                            1.3.6.1.4.1.20006.1.3.1.17(12,0)

     

     

    Here an example when the nHostname.nHostEventIndex and nSvcDesc.nSvcEventIndex variables are missing.

    iReasoning_Nagios_trap_missing_index.png

     

     

    Here an example when the nHostname.nHostEventIndex and nSvcDesc.nSvcEventIndex variables are available.

    iReasoning_Nagios_trap.png



  • 6.  Re: Event Disp, IP filter

    Posted Oct 27, 2014 07:54 AM

    Thanks people, my task is receive a trap from nagios and alert the device in Spectrum, but the alarm must be on interface. Therefore my idea is use the network direction and the index of the interface.

     

    The problem is that I don't know do this. The Syntax is very confused.

    Thanks to You for the documentation, because the procedures don't are well explicated on the manual.

     

    Is possible receive a trap with the IP device and that select on Spectrum device? What would be the attribute? Or a example of the procedure for receive an alarm by IP Address?

     

    Regards!



  • 7.  Re: Event Disp, IP filter

    Broadcom Employee
    Posted Oct 27, 2014 09:20 AM

    Are you sure those information are in the trap from Nagios?

    I have looked at the MIB tree, but I don't think interface index is there.

    NAGIOS-NOTIFY-MIB Tree

     

    Anyway you can follow this guide.

    Chapter 6: Southbound Gateway Case Study

    This chapter walks you through an integration with a typical third-party management software that can send SNMP traps to CA Spectrum.

    CA Spectrum Southbound Gateway Toolkit Guide release 9.4

     

    Some information such as Network Address, MAC Address, Target Name, etc, should be mapped to specific Variable IDs.

     

    Map_Trap.png

     

    Also take a look at page 28 of Southbound Gateway Guide - Event Data Template Fields for further information.



  • 8.  Re: Event Disp, IP filter

    Posted Oct 27, 2014 09:32 AM

    Yes, I go to modify the Nagios Script for this data. OK, I go to look the guide,  I can use a XML script? 



  • 9.  Re: Event Disp, IP filter
    Best Answer

    Broadcom Employee
    Posted Oct 27, 2014 09:42 AM

    Yes. You can create an XML file to send events to CA Spectrum. It is also covered in the Southbound Gateway Guide.



  • 10.  Re: Event Disp, IP filter

    Posted Oct 27, 2014 09:56 AM

    Perfect, Thanks for all. I go to try with this.