DX NetOps

Expand all | Collapse all

Hi, really need some help with Dynamic Alarm Title

Jump to Best Answer
  • 1.  Hi, really need some help with Dynamic Alarm Title

    Posted 09-29-2014 07:17 AM

    Hi, I'm really having some issues with Dynamic Alarms title, and I'm sure someone here can help.

    I start of with a new trap that I have mapped to an event event code is: 0xfff0011e, this has a number of variables passed into it of which I want to use 2 of them to create a dynamic alarm title, as well as some free text.  What I want to achieve is the following:

     

    "Message String1" "VAR 23 from trap"  "Message String2" "Var 34 from trap"

     

    This doesnt seem to be that tricky from the documentation but they dont seem to explain how you can get 2 variables from the original event into the alarm title, has anyone else achieved this?

     

    Thanks,

    Ben.



  • 2.  Re: Hi, really need some help with Dynamic Alarm Title

    Posted 09-29-2014 07:45 AM

    Ben,

     

    You will need to use an Event Procedure with the Append parameter. The following is an example:

     

    0xfff00000 E 0 P "CreateEventWithVariables({ C CURRENT_MODEL },{ H 0xfff00001 },SetEventVariable (GetEventVariableList(),{ H 0x00012b4c },Append({ S \"Alarm: \" },Append(Append({ S \"\" },GetEventVariable ( { U 103 } )),Append({ S \" Job: \" },Append (Append ({ S \"\" },GetEventVariable ( { U 104 })),Append ({ S \" Event: \" },GetEventVariable ( { U 101 } ))))))))"

     

    In the above example, the resulting Alarm Title will have the following format:

     

    Alarm: <Value of varbind 103> Job: <Value of varbing 104> Event: <Value of varbind 101>

     

    Regards,

     

    Joe



  • 3.  Re: Hi, really need some help with Dynamic Alarm Title

    Posted 09-29-2014 07:51 AM

    that great thanks Joe, the only thing I cannot seem to find is any documentation on the Append command within the CA Event Configuration User guide, do you have another guide to point me at that I can use to understand the syntax of this command?

     

    Thanks,

    Ben.



  • 4.  Re: Hi, really need some help with Dynamic Alarm Title

    Posted 09-29-2014 08:19 AM

    Ben,

     

    Unfortunately, the Append parameter is not discussed in the Event Configuration guide.

     

    The following is the only thing I have been able to find.

     

    Append

     

    Procedure  Usage  Compatibility    

    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. 

     

    Joe



  • 5.  Re: Hi, really need some help with Dynamic Alarm Title

    Posted 09-29-2014 11:13 AM

    all Spectrum Event procedures are defined in single files located at $${SPECROOT}/SS/CsVendor/CA/Procedures/ containing the relevant parameters.

    You may ask CA support for some additional advice/documentation on EventProcedures.



  • 6.  Re: Hi, really need some help with Dynamic Alarm Title

    Posted 09-30-2014 04:41 AM

    Hi Joe, sorry to ask again, I've implemented the following Event Procedures:

     

    0xfff0011e E 20 P "   CreateEventWithVariables({ C CURRENT_MODEL },{ H 0xfff01137 },            SetEventVariable (GetEventVariableList(),{ H 0x00012b4c },Append({ {

    S \"Apps:-CDW Task \" },Append(Append({ S \"\" },GetEventVariable  ( { U 4 } )),Append({ S \" on node: \" },Append (Append ({ S \"\" },GetEventVariable ( { U 11 })),

    Append ({ S \" is overrunning \" },GetEventVariable ( { U 4 } ))))))))"

     

    But I still get a blank alarm title, is there something I need to add to the new Event 0xfff01137?

     

    Also the procedured doesnt seem to be triggerring, as I dont see the new event 0xfff01137?

     

    Any Thoughts?

     

    Thanks in advance for your assistance.

    Ben.




  • 7.  Re: Hi, really need some help with Dynamic Alarm Title

    Posted 10-01-2014 12:03 PM

    Powell,

     

    Enable the debug for event disp and event procedure in .vnmrc file.Update the event configuration on vnm model to apply the changes. That should give you the output in vnm.out. Make sure the var bind values you pass are string otherwise you need to use "Tostring" function in the event proccedure.

     

    Ex:

     

    0x00010f03 P"\

    CreateEventWithVariables(\

    {C CURRENT_MODEL},\

    {H 0xfff0012d},\

    SetEventVariable(\

    GetEventVariableList(),\

    {H 0x00012b4c},\

    Append(\

    {S\"High CPU Utilization : Threshold - Utilization:\"},\

    Append(\

    Append(\

    Append(\

    { S \"\" },\

    ToString(GetEventVariable ( { U 0 }))),\

    {S \" - \" }),\

    ToString( GetEventVariable({U 1}))))))"

     

    Regards

    Kalyan



  • 8.  Re: Hi, really need some help with Dynamic Alarm Title
    Best Answer

    Posted 09-30-2014 09:10 AM

    Hi Ben

     

    Append simply takes 2 values and concatenates them. You can nest the Append calls too which means that 1 of the values can be another call to the Append function (as in the example below). Coming from a software development background I find it a little easier if I collect values into variables first before using them. It's also a lot easier to read if you format it like source code. Here's an example appending 2 values:

    • The host name is in the trap varbind that's mapped to variable 101
    • The value we want to use for the alarm title is contained in the trap varbind that's mapped to variable 102

     

    Append is used to concatenate the values so we get an alarm title like: "Whatever the alarm title is on hostname"

     

    0xff0fffde P " \

      SetVariable({V hostName}, ToString(GetEventVariable({U 101})), \

        SetVariable({V alarmTitle}, ToString(GetEventVariable({U 102})), \

          CreateEventWithVariables({C CURRENT_MODEL},{H 0xff0fffdd}, \

            SetEventVariable(GetEventVariableList(), {H 0x12b4c}, \

              Append({V alarmTitle}, Append({S \" on \"}, {V hostName})) \

            ) \

          ) \

        ) \

      )"

     

    Hope that helps.



  • 9.  Re: Hi, really need some help with Dynamic Alarm Title

    Posted 10-02-2014 12:28 PM

    Thanks all, I've got this working now, I was really facing issues with the syntax as I have 5 strings and variables to put together so the append command because huge.

     

    Thanks again for your responses.



  • 10.  Re: Hi, really need some help with Dynamic Alarm Title

    Posted 12-10-2018 02:31 AM

    Hi Craig,

     

    I understand that 0x12b4c is the code for the Alarm Title, but do you know what it is the code for Alarm Text? I want to append an attribute (ifAlias) to it.

     

    Thanks and best regards,

    Marcelo



  • 11.  Re: Hi, really need some help with Dynamic Alarm Title

    Posted 12-10-2018 05:11 AM

    Alarm text and alarm title are the same thing. It's whatever you want it to be. In my example I created a variable called alarmTitle which mapped to a trap varbind with ID 102 as defined in the AlertMap file. If the value you want to use (eg. ifAlias) is not contained in one of the trap varbinds then you should be able to get it from the attribute of the device that generated the trap.

     

    Here's what I would try. The ifAlias attribute ID is 0x11f84. So in the first line I've replaced "{V hostName}" with "{V ifAlias}" to create a variable called ifAlias,  and replaced "ToString(GetEventVariable({U 101}))" with "{a 0x11f84}" to set the value to whatever is contained in the device's 0x11f84 attribute. Then just add that value into the alarm title by replacing "{V hostName}" with "{V ifAlias}" (you can change that to make the alarm title whatever you want it to be).

     

    0xff0fffde P " \

      SetVariable({V ifAlias}, {a 0x11f84}, \

        SetVariable({V alarmTitle}, ToString(GetEventVariable({U 102})), \

          CreateEventWithVariables({C CURRENT_MODEL},{H 0xff0fffdd}, \

            SetEventVariable(GetEventVariableList(), {H 0x12b4c}, \

              Append({V alarmTitle}, Append({S \" on \"}, Append({V ifAlias}))) \

            ) \

          ) \

        ) \

      )"