DX Unified Infrastructure Management

  • 1.  LUA script keeps crashing nas

    Posted Sep 11, 2018 09:16 AM

    Hello everyone,

     

    I am currently testing a script triggerd by an oa profile that sets every alarms custom_2 field based on the origin (our customer hub) for assigned alarms to the correct user/customer in SDM.
    The script seems to run perfectly fine for a while but has the nas probe crashing and refusing to work after a while, which is always a different amount of time.

    As I'm pretty new to LUA and scripts triggered by nas in general I'd like to know if anyone here has encountered similar issues.


    Here's what the script does:

    -- Get the profile filtered alarm (on arrival)
    local a = alarm.get()

    -- assign a custom_2 field based on the alarms origin
    if ( a ~= nil and a.origin ~= nil ) then
    local up = {}
    up.nimid = a.nimid
    if ( a.origin == "customer-A" ) then
    up.custom_2 = "Monitoring_customer-X"
    elseif ( a.origin == "customer-B1" or a.origin == "customer-B2" ) then
    up.custom_2 = "Monitoring_customer-B"
    else
    up.custom_2 = "Monitoring_" .. a.origin
    end
    alarm.set(up)
    end

    Am I missing something here?

     

    Best regards,
    Steffen



  • 2.  Re: LUA script keeps crashing nas

    Broadcom Employee
    Posted Sep 11, 2018 10:59 AM

    Hi,

     

     

    What NAS version?  it might be worth trying the latest hotfix version:

     

     

    https://support.ca.com/us/product-content/recommended-reading/technical-document-index/ca-unified-infrastructure-management-hotfix-index.html

     

    CA Unified Infrastructure Management Hotfix Index - CA ...<https://support.ca.com/us/product-content/recommended-reading/technical-document-index/ca-unified-infrastructure-management-hotfix-index.html>

    support.ca.com

    Change Download Preference. {{errorInSavingPref}} Current Preference

     

     

     

     

    Thanks,

    Jason Allen

    Principal Support Engineer

     

     

    CA Technologies | 3333 Walnut St | Boulder CO  80301

    Office: +1 970 818 3856 | Jason.Allen@ca.com

     

    <mailto:Jason.Allen@ca.com>

     



  • 3.  Re: LUA script keeps crashing nas

    Posted Sep 12, 2018 03:01 AM

    Hi Jason,

    we're using nas v. 8.52 in UIM 8.5.1

     

    Regards,

    Steffen



  • 4.  Re: LUA script keeps crashing nas

    Broadcom Employee
    Posted Sep 12, 2018 06:43 AM

    Script looks OK but do you need to run "on message arrival” rather than "on overdue age” ?

     

    If you are doing this on every alarm, you might like to try doing this in Pre_processing section and use the event.origin construct but it might slow things down so hopefully you don't have too many alarms being processed..

     

    Custom Pre-Processing

    The event table is placed into the LUA context prior to executing the "custom” pre-processing rule. You may alter (launder) the event by setting the fields message, level, sid, source, hostname, user_tag1, user_tag2, visible, custom_1 to custom_5, supp_key and origin. The following fields are present for the script to use:

    .source - source of the alarm (typically ip-address)

    .hostname - resolved name (robotname or ip-address to name resolution)

    .level - severity level (0-5)

    .sid - subsystem identification.

    .message - alarm message text.

    .origin - origin of the alarm (stamped by nearest hub, or in some cases the robot.)

    .domain - name of originating NimBUS domain.

    .robot - name of the sending robot.

    .hub - name of the nearest hub to the sending robot.

    .prid - name of probe issuing the alarm.

    .user_tag1 - user tag 1 (as set by robot).

    .user_tag2 - user tag 2 (as set by robot).

    .supp_key - suppression identification key.

    .visible - flag for visibility (true = visible)

    The script is expected to return the event (modified or not) or nil. The nil will indicate that the event is to be skipped.

     



  • 5.  Re: LUA script keeps crashing nas

    Posted Oct 12, 2018 09:48 AM

    Hi ahd ,

     

    Any update on this issue? Were you able to try Rowan's suggest?

     

    Thanks in advance for your feedback.