DX NetOps

 View Only
Expand all | Collapse all

Create a dynamic alarm

  • 1.  Create a dynamic alarm

    Posted Aug 20, 2020 10:51 AM
    Edited by Assistance GAR Aug 20, 2020 10:51 AM
    Hello Everyone,

    I'm trying to create a dynamic alarm , the purpose is to show in the alarm three value of three variables from the trap.

    I created a new code 0xfff00027 for the event procedure
    0xfff01f69 is the critical alarm


    Normally i can use this format to show only one variable :

    0xfff00027 P " CreateEventWithVariables( { C CURRENT_MODEL }, { H 0xfff01f69 },SetEventVariable(GetEventVariableList(),{ H 0x00012b4c },Append( { S \"Critical alarm: \" },GetEventVariable( { S 1 } ) ) ) )"

    0xfff01f69 E 20 A 3,0xfff00027

    Can you tell me please how i edit this code to have three variable in the alarm please ?

    The variable are all with string types.

    Thank you

    Sara



    ------------------------------
    Sara
    ------------------------------


  • 2.  RE: Create a dynamic alarm

    Broadcom Employee
    Posted Aug 20, 2020 11:32 AM
    Sara,

    You will need to use multiple Append parameters in your procedure.

    The following knowledge article has a good example:

    https://knowledge.broadcom.com/external/article?articleId=48841

    Joe


  • 3.  RE: Create a dynamic alarm

    Posted Aug 21, 2020 08:29 AM
    Edited by Assistance GAR Aug 21, 2020 08:31 AM
    Hello Josheph,

    I tried the Kb you sent to me, but i still dont have the title alarm

    I found this kb: 
    https://community.broadcom.com/communities/community-home/digestviewer/viewthread?MID=800803

    First, to show only two variables, i used this code :
    0xfff01f6a E 0 P " CreateEventWithVariables( {C CURRENT_MODEL}, {H 0x5e100017}, SetEventVariable( SetEventVariable( GetEventVariableList(), {H 0xfff01f6b}, Append({S \"device - \"}, GetRegexp( GetEventVariable({ I 0 }), { S \"with normal (.*)\" }, { I 2 } ))
    0xfff01f6c E 0

    the 0xfff01f6a is the code of the event procedure.
    the 0x5e100017 is the code of the trap
    0xfff01f6c and 0xfff01f6b are new codes for the two variables.

    But i still have an empty alarm. Can you tell me please if i need to add something else ?

    Thank you 

    Sara


  • 4.  RE: Create a dynamic alarm

    Broadcom Employee
    Posted Aug 21, 2020 08:44 AM
    Sara,

    It does not matter if the event is from a trap or not, the functionality is still the same.

    If I am correct, you want to include attribute values in your dynamic alarm title, correct?

    If so, you will need to use the GetEventAttributeList to save the value of the attribute to an event variable. not the GeteEventVariableList.

    The following knowledge article has an example of how to do this.

    https://knowledge.broadcom.com/external/article?articleId=51929

    So what you will need to do is configure multiple Append parameters in your event procedure to add these attribute values to the dynamic alarm title event variable 0x12b4c.

    Joe


  • 5.  RE: Create a dynamic alarm

    Posted Aug 21, 2020 11:05 AM
      |   view attached
    Hello Joseph,

    I need to show the values from the traps not getting the values from the attributes.
    I followed the first KB you sent to me but it's not really showing me the title alarm. this is my code :
    code
    The 0xfff01ef3 is the code of the trap where i have all the variables, it still with none status and the some conditions in event condition to generate the critical alarm with the code 0xfff01f62
    The code 0x00012b4c, i puted it by default in the event disp. should i create it in the event configuration ?
    Then { I 1 } and { S2 } are the variables that i need to show in the title alarm.

    This is the format of the trap :

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

    Notification that an alarm is currently active

    currentAlarmId = {I 1}
    friendlyName = {S 2}
    eventTime = {S 3}
    ----
    With this details, do you think that i need to add other configurations so that i get the title alarm ?

    Thank you.

    Sara


  • 6.  RE: Create a dynamic alarm
    Best Answer

    Broadcom Employee
    Posted Aug 21, 2020 02:07 PM
    Sara,

    I did this up in the lab:

    0xfff00004 E 0 A 3,0xfff00004

    0xfff00003 E 0 P "CreateEventWithVariables({ C CURRENT_MODEL },{ H 0xfff00004 },SetEventVariable (GetEventVariableList(),{ H 0x00012b4c },Append({ S \"\" },Append(Append({ S \"\" },GetEventVariable ( { U 1 } )),Append({ S \" - \" },Append (Append ({ S \"\" },GetEventVariable ( { U 2 } )),Append ({ S \" - \" },GetEventVariable ( { U 3 } ))))))))"

    The value of event variable 1 from my trap is "Test", 2 is "Event" and 3 is "Procedure".

    I used TrapGen to send the trap to Spectrum and I see the following alarm title:


    Joe



  • 7.  RE: Create a dynamic alarm

    Posted Aug 24, 2020 10:45 AM
    Edited by Assistance GAR Aug 24, 2020 10:59 AM
    Hello Joe, 

    I used exacty the same configuration:
    0xfff01ef3 E 0 P "CreateEventWithVariables({ C CURRENT_MODEL },{ H 0xfff01f61 },SetEventVariable (GetEventVariableList(),{ H 0x00012b4c },Append({ S \"\" },Append(Append({ S \"\" },GetEventVariable ( { S 5 } )),Append({ S \" - \" },Append (Append ({ S \"\" },GetEventVariable ( { S 12 } )),Append ({ S \" - \" },GetEventVariable ( { S 7 } ))))))))"

    then I sent the trap with trap sender. but I still have an empty title.
    Can you confirm to me that 0xfff00003 is the code of the trap and 0xfff00004 is the code of the alarm  please? should i let the code alarm with an empty title in the event configuration ?

    I didnt use the first line because i have other code to do the conditions :
    0xfff01ef3 E 20 R CA.EventCondition, "({v 6} == {S \"critical\"} && {v 5} == {S \"Input LOS\"})" , "0xfff01f5e -:-" R CA.EventCondition, "({v 6} == {S \"warning\"} && {v 4} != {S \"QUALITY OF SERVICE\"})" , "0xfff01f5f -:-" R CA.EventCondition, "({v 6} == {S \"major\"} && {v 5} != {S \"FACEPLATEMISS\"})" , "0xfff01f60 -:-" R CA.EventCondition, "({v 6} == {S \"critical\"} && {v 5} == {S \"LANLOS\"})" , "0xfff01f61 -:-" R CA.EventCondition, "({v 6} == {S \"critical\"} && {v 5} == {S \"Card failure - device\"})" , "0xfff01f62 -:-" R CA.EventCondition, "({v 6} == {S \"critical\"} && {v 5} != {S \"LANLOS\"} && {v 5} != {S \"Card failure -device\"} && {v 5} != {S \"Input LOS\"})" , "0xfff01f63 -:-" R CA.EventCondition, "({v 6} == {S \"minor\"} && {v 4} != {S \"QUALITY OF SERVICE\"})" , "0xfff01f5f -:-"

    I think that i have a problem with a synchronisation between the event configuration and my files. when  I search in the event configuration for the code of the alarm i don't find any event procedure related to it.
    But i always click in update event configuration in the vnm and Update Event and Alarm Files > reload.

    Ill keep testing and let you know if it work.

    Thank you

    Sara



  • 8.  RE: Create a dynamic alarm

    Broadcom Employee
    Posted Sep 09, 2020 09:56 AM
    With recent versions of Spectrum, you can also add event variables to the PCause to make dynamic alarm titles instead of using event procedures:

    https://techdocs.broadcom.com/us/en/ca-enterprise-software/it-operations-management/spectrum/10-4-2/managing-network/event-configuration/working-with-events-and-alarms.html

    Scroll down to "Creating Dynamic Alarm Title"

    -Rob


  • 9.  RE: Create a dynamic alarm

    Posted Sep 21, 2020 04:12 AM
    Hi Robert,

    Thanks for this updaye. it's really helpfull.

    Kinds regards

    Sara​


  • 10.  RE: Create a dynamic alarm

    Posted Sep 21, 2020 04:11 AM
    Hello Joe,

    thank you.
    That really help me to get all the values.

    Have a nice day !

    Sara​


  • 11.  RE: Create a dynamic alarm

    Posted Oct 14, 2020 11:27 AM
    Edited by Assistance GAR Oct 14, 2020 11:27 AM

    Hello,

    The technical solution is working properly, but i noticed a strange behavior.
    The alarm title is empty when one of the variable trap is empty, is there any solution for this please ?

    Thanks and regards
    Sara




  • 12.  RE: Create a dynamic alarm

    Broadcom Employee
    Posted Oct 14, 2020 03:19 PM
    Sara,

    The only thing I can think of is to add an "if" statement to the event procedure checking of the trap varbind has a value or not.

    Unfortunately, I am not sure how to accomplish this.

    Does anyone have any experience using the "if" statement in an event procedure?

    Joe


  • 13.  RE: Create a dynamic alarm

    Broadcom Employee
    Posted Oct 14, 2020 04:44 PM
    I've got one:

    0x3dc0004 P "If ( Regexp( GetEventVariable({U 17}), {S \"\\\\[sdwan\\\\]\"}),\
                                   CreateEventWithVariables( { C CURRENT_MODEL }, {H 0x066e2000},\
                                              SetEventVariable( GetEventVariableList(), {H 0x12b4c},\
                                                     GetRegexp( GetEventVariable( {U 17} ), {S \"\\\\[sdwanDatapathSlaNotMet\\\\] \\\\[.*\\\\] (.*)\"}, {U 1}))),\
                                   CreateEventWithVariables( { C CURRENT_MODEL }, { H 0x06a50006 }, SetEventVariable(GetEventVariableList(), {H 0x12b4c}, GetRegexp( GetEventVariable( { U 17 } ), {S \" (%[A-Za-z0-9_-]*:.*)\"}, {U 1} ) )))"


  • 14.  RE: Create a dynamic alarm

    Posted Oct 16, 2020 08:49 AM
    Hello,
    Thanks Joe,
    Robert, accutually i need to show three or 4 variables.. so i used this code :

    0xfff01f72 E 0 P "CreateEventWithVariables({ C CURRENT_MODEL },{ H 0xfff01f61 },SetEventVariable (GetEventVariableList(),{ H 0x00012b4c },Append({ S \"\" },Append(Append({ S \"\" },GetEventVariable ( { U 5 } )),Append({ S \" - \" },Append (Append ({ S \"\" },GetEventVariable ( { U 7 } )),Append ({ S \" - \" },GetEventVariable ( { U 12 } ))))))))"
    0xfff01f78 E 0 P "CreateEventWithVariables({ C CURRENT_MODEL },{ H 0xfff01f79 },SetEventVariable (GetEventVariableList(),{ H 0x00012b4c },Append({ S \"\" },Ap
    0xfff01ef3 R CA.EventCondition, "({v 6} == {S \"warning\"} && {v 4} != {S \"QUALITY\"})" , "0xfff01f74 -:-" R CA.EventCondition, "({v 6} == {S \"critical\"} && {v 8} == {S \"Input\"})" , "0xfff01f73 -:-" R CA.EventCondition, "({v 6} == {S \"minor\"} && {v 4} != {S \"QUALITY\"})" , "0xfff01f74 -:-" R CA.EventCondition, "({v 6} == {S \"major\"} && {v 5} != {S \"FACEPLATEMISS\"})" , "0xfff01f75 -:-" R CA.EventCondition, "({v 6} == {S \"critical\"} && {v 8} == {S \"failure\"})" , "0xfff01f77 -:-" R CA.EventCondition, "({v 6} == {S \"critical\"} && {v 8} == {S \"LAN\"})" , "0xfff01f72 -:-" R CA.EventCondition, "({v 6} == {S \"critical\"} && {v 8} != {S \"LAN\"} && {v 8} != {S \"failure\"} && {v 8} != {S \"Input\"})" , "0xfff01f76 -:-"
    0xfff01f61 E 0 A 3,0xfff01f61,U

    And i need to know please if there is a way to edit it and do a condition to show variables even if one or more variables are empty.
    Thanks for your help.

    KInds regards
    Sara