UK CA Unified Infrastructure Management User Group

Rebuild alarm after processing through LUA

  • 1.  Rebuild alarm after processing through LUA

    Posted 06-25-2018 08:50 AM

    Hi all,

     

    I'm looking for a way to rebuild an alarm after I've stripped out the ampersands from the alert text.

     

    I need to strip out the Ampersands so it can be passed to an XML document which then feeds into our ticketing system.

     

    Here's the code I have so far (which is working) but the alert that gets generated appears as if it's come from the NAS and our primary UIM Server.

     

    All the other details come through on the new alarm perfectly!

     

    a = alarm.get ()

    message = a.message

    message1 = string.gsub(message, "%&","&") -- change string parts
    if a ~=nil

    then

    nimbus.alarm (1, message1, a.supp_key,a.hostname, a.source, a.origin, a.hub, a.user_tag2, a.prid)

    end

     

    Also, when I "print" the output it comes out correctly, but when it sends it as an alarm it appears to override the probe and Robot

     

    I've read through this script but I'm not sure on how I can intergrate it into what I'm looking for:

     

    https://communities.ca.com/message/242031950-re-create-new-alarm-using-lua?commentID=242031950#comment-242031950 

     

    Any help would be greatly appreciated

     

    Cheers,