DX Unified Infrastructure Management

  • 1.  New alarm created in NAS

    Posted Jan 29, 2016 09:18 AM

    Dear experts,

    I need to create new/derived alarm if original alarm does not come from logmon probe between starttime and endtime. User do not care about original alarm.

    So I decided:

    • to make original alarm invisible in NAS pre-preprocessing
    • to close it in NAS profile.
    • and to run a script in NAS schedule. In the script, I try to find alarm in nas_transaction_summary table and it it does not exist I want to raise new/derived alarm

    First, I used nimbus.alarm to raise new/derived alarm, but it does not set dev_id, so alarm is not visible in UMP.

    Then I found post "Generate New Alarm? User_tag2" about PDS and nimbus.create - actually it is not absolutely clear to me, how to use PDS. There is a link to example in the post, but the page is not available yet.

    Below is extract from my script, that unfortunately does not work. It returns 0, but does not create the alarm. At least, I am not able to find it anywhere (IM, DB, UMP).

    Could you advice me, what is wrong with my script?

    Kind regards,

    Marek L.

     

    -------------------------------------------------------------------------------------------------------------------

     

    msg=pds.create()

    controller=nimbus.request("controller","get_info")

     

    suppkey="NAS"..PREFIX..key..SUFFIX

    message="APP: Expected alarm not found - Keyword,StartTime,EndTime: "..key..","..stime..","..etime

    print(nimid..", "..suppkey..", "..message)

     

    -- Create message

    pds.putInt(msg,"nimts",timestamp.now() )

    pds.putString(msg,"subject","alarm")

    pds.putInt(msg,"pri",1)

    pds.putInt(msg,"level",5)

    pds.putString(msg,"source",IPADDR)

    pds.putString(msg,"origin",controller.origin)

    pds.putString(msg,"domain",controller.domain)

    pds.putString(msg,"robot",SERVER)

    pds.putString(msg,"prid","logmon")

    pds.putString(msg,"suppression","y+000000000#"..suppkey)

    pds.putString(msg,"supp_key",suppkey)

    pds.putString(msg,"dev_id",DEVID)

    pds.putString(msg,"met_id",METID)

    pds.putString(msg,"subsys","1.1")

    pds.putString(msg,"message",message)

    pds.putString(msg,"visible","1")

     

    -- Post the message to the hub-spooler

    t,rc=nimbus.request("spooler","hubpost",msg)

    print(rc)

     

    pds.delete(msg)



  • 2.  Re: New alarm created in NAS
    Best Answer

    Posted Jan 29, 2016 02:43 PM

    It seems like you aren't actually generating the actual data portion of the alarm message, called "udata" which should contain the message, subsys, level etc instead of the root level. Check out this thread: Impersonating an alarm from the sending probe using raw-alarms. You shouldn't need to bother with the nimid part these days though.

     

    -jon



  • 3.  Re: New alarm created in NAS

    Posted Feb 01, 2016 04:51 AM

    Jon,

    thank you for your answer, example from the link works perfectly.

    Kind regards,

    Marek L.