DX Unified Infrastructure Management

 View Only
  • 1.  Generating new alarm with specific user tag

    Posted Dec 12, 2011 01:58 PM

    Hi

     

    I like to generate a new alarm with user_tag2 = "7x24"

    Here is my LUA skript:

     

    rc, nimid = nimbus.alarm (severity, message, suppressionKey, suppressionID, source)

     

    thisAlarm = alarm.get(nimid)
    if thisAlarm ~= nil then
    changeAlarm = {}
    changeAlarm.nimid = thisAlarm.nimid
    changeAlarm.user_tag2 = "7x24"
    alarm.set(changeAlarm)
    end

     

    The new alarm is generated but the set alarm function with user_tag2 has no effect.

     

    Can anybody help me to solve this issue.

     

    Thanks

     

    Paul



  • 2.  Re: Generating new alarm with specific user tag

    Posted Dec 12, 2011 02:12 PM

    Hi!

     

    Doing some similiar (hpoefully ;->), but in preprocessing as script.

     

    event.user_tag2="itopfilter"

    return event

     

     

    cheers

    Matthias



  • 3.  Re: Generating new alarm with specific user tag

    Posted Dec 12, 2011 06:50 PM

    Hi mgruber

     

    Thanks a lot, this is working. But the script is divided in to two places.

    If possible I like to handle everything in one go in one script.

    But it looks like this will be the solution for my requierment.

     

    Regards

    Paul



  • 4.  Re: Generating new alarm with specific user tag

    Posted Dec 12, 2011 08:15 PM

    I can think of two ways you might be able to do this in one script:

     

    • Put a sleep() between sending the alarm message and looking for the alarm. If you do this, you could even make a loop and retry several times (sleeping between each attempt) if the alarm is not there yet.
    • Use the rawalarm() function to set the user tag directly in the alarm message.


  • 5.  Re: Generating new alarm with specific user tag

    Posted Dec 12, 2011 05:28 PM

    Can you have the script do something if the nil test fails, so you can see if that is the problem? The script might be looking for the alarm before the NAS has created an alarm. The nimbus.alarm() function does not create an alarm. It creates an alarm message, which must still be processed by the NAS before the NAS creates the alarm (or updates an existing alarm, depending on the suppression rules).



  • 6.  Re: Generating new alarm with specific user tag

    Posted Dec 12, 2011 06:40 PM

    Hi Keith

     

    Yes, the statement "if thisAlarm ~= nil then"  is nil. Therefore the set alarm is not executed at all.

     

    regards

    Paul