11 Replies Latest reply: Mar 13, 2012 5:53 AM by Rahul NameToUpdate RSS

automatic opening remedy ticket

cresg82

hi,

i need to open automaticaly a remedy from BEM but I couldn't use IBRSD integration. I do this:

create a test cell with a new KB

propagate all event from production cell to test cell with a propagation rule.

on the test cell i create this rule file:

execute Open_Critical:

  EVENT ($EV) where [severity: equals "CRITICAL"]

  when $EV.status: equals OPEN

  {

  set_timer($EV,600,set_expiry);

  }

END

 

 

execute Open_Warning:

  EVENT ($EV) where [severity: equals "WARNING"]

  when $EV.status: equals OPEN

  {

  set_timer($EV,1800,set_expiry);

  }

END

 

 

timer set_expiry_timer: EVENT ($EV) where [severity: not_equals "OK" AND status: equals OPEN]

timer_info: == set_expiry

{

  execute($EV,"open.bat",[">>C:\opens.txt"],NO);

}

END

 

 

but it don't work how i hoped. It's the right way to do this?

 

 

thanks

  • 1. automatic opening remedy ticket
    Niranjan Panigrahi

    Hello,

     

    Is there any specific reason you do not want to use IBRSD?

    IBRSD has the required workflow that will help in propagating the information to the AR Server and generating an incident.

     

    What do you have in this open.bat ?

     

    Regards,

    Niranjan

  • 2. automatic opening remedy ticket
    cresg82

    for the moment open.bat contains this:

    @ECHO OFF

    %time%;%mc_host%

     

     

    and for the moment my problem is that the rule i created doesn't work like i hoped and i'm sure there is something wrong.

     

     

    The next step is to modify bat to make an http request to a specific server. My remedy administrator created a web page "http://myremedy.com.it/openremedy?$host$user....." which opens a remedy when i make an http request of those type.

     

     

    My idea is to set a timer according the event severity. For example for Critical Events 10 minutes. After 10 minutes if the event is still critical invoke the open.bat

     

     

    I don't know if this is the right way or not but it's the only thing i thinked.

     

     

    Because of internal policies for the moment  IBRSD cannot be installed and configured.

  • 3. automatic opening remedy ticket
    Niranjan Panigrahi

    I doubt that will work because the IBRSD module has the logic of mapping the Event Slots to the Fields on the AR forms.  I am not sure how you can achieve using the script. The Script is not capable to handle the workflow in the AR side.

     

    Instead you can use a propagate rule to propagate the eventsto the IBRSD instance, delaying it by some time (as per your requirement) andthen IBRSD will take care of the rest of the things till Incident creation.

  • 4. automatic opening remedy ticket
    cresg82

    thank you for the answer,

    i don't need to follow the event in remedy. I need to open a remedy ticket every time a event doesn't close after X minutes. The script works but the problem is that it doesn't opens all events. I think it's something wrong in the rules that i wrote.

  • 5. automatic opening remedy ticket
    Carlos Slone

    Without getting into the challenges of not using IBRSD for its purpose or your actual call to the script (where I don't know the specifics), the only thing I can see could be causing an issue is enclosing OK in quotes.

     

    severity is an enumerated field, so your rule's ECF should read 

     

    where [severity: not_equals OK AND ...       (No quotes).

     

     

     

    Carlos.

  • 6. automatic opening remedy ticket
    cresg82

    I inserted this rule:

     

     

    new parsing_1:

      EVENT($EV)

      triggers

      {

      execute($EV,"parse.bat",[">>C:\new_1.txt"],NO);

      }

    END

     

     

    parse.bat  does this:

    echo %time%,%mc_host_adress%,%mc_object%

     

     

    so if I didn't make a mistake for every new incoming event the cell must write in a file called new_1.txt the informations specified above. But I notated that only some new events are "parsing" and i don't understand why.

  • 7. automatic opening remedy ticket
    Carlos Slone

    I'm a litle confused here...

     

    What's the purpose of the new rule you inserted?

     

    Also, be cognizant of the rule phase and rule order. This could be the reason you're perceiving the parsing not to be happening for all events, but I can't say for certain, as I'm still trying to understand the expected results of the rule in a particular context.

     

     

    Carlos.

  • 8. automatic opening remedy ticket
    cresg82

    my idea is this one:

    a)for any incoming events with severity critical set a timer for x seconds.

    b)for any incoming events with severity warning set a timer for y seconds.

    b)When timer expires if the event is still in an opened status and with a critical or warning  severity execute open_remedy.

     

    In the" .load" file I added a line at the end: open_remedy and in the rules folder I inserted a open_remedy.mrl file. In this file i tried to insert several types of rules but i'm doing something wrong. The last one is this:

     

    execute exe_parse:

        EVENT($EV)

        when $EV.mc_operations

        {

            set_timer($EV,600,"TO_OPEN");

            execute($EV,"parse.bat",[">>C:\parse_exe.txt"],NO);

        }

    END   

     

    timer open:

        EVENT ($EV) where [ status: equals OPEN AND severity: equals CRITICAL]

        timer_info: equals "TO_OPEN"

        {

            execute($EV,"parse.bat",[">>C:\opens.txt"],NO);

        }

    END

     

    Now i think it's work better then previous rules but i'm still verifing.

  • 9. automatic opening remedy ticket
    Carlos Slone

    OK. This definitely looks like a better choice of rule than the previous one you posted (the one in the new phase) for achieving your desired result.

     

    The only comment I'd add is the fact that -as your rule currently stands- the timer will only be set for events that have their mc_operations field updated after the rule has triggered.

     

    If you want it to set the timer for every event (I would exclude events with a status of CLOSED and BLACKOUT in the ECF, by the way), I'd change the "when" clause to something like

     

    when status: equals OPEN

     

     

     

    Carlos

  • 10. automatic opening remedy ticket
    cresg82

    I modified the rule:

    execute exe_parse:

      EVENT($EV) where [status: equals OPEN ]

      #when $EV.mc_operations

      when $EV.severity

      {

      if $EV.severity equals CRITICAL then

      {

      set_timer($EV,600,"critical");

      execute($EV,"parse.bat",[">>C:\critical.txt"],NO);

      }

      else

      {

      set_timer($EV,1800,"warning");

      execute($EV,"parse.bat",[">>C:\warning.txt"],NO);

      }

      }

     

    END

     

     

    timer open:

      EVENT ($EV) where [ status: equals OPEN AND severity: greater_or_equals WARNING]

      timer_info: equals "critical"

      {

      execute($EV,"parse.bat",[">>C:\opens.txt"],NO);

      $EV.status=ACKNOWLEDGED|CLOSED

      }

      timer_info: equals "warning"

      {

      execute($EV,"parse.bat",[">>C:\opens.txt"],NO);

      $EV.status=ACKNOWLEDGED|CLOSED

      }

    END

     

    but i don't know what to make of the event when i open a remedy. I must acknowledge or close the event?

  • 11. automatic opening remedy ticket
    Rahul NameToUpdate

    Hi, Is your script good enough to create incident in Remedy for respecitve BEM event.

    If so u can modify ur script to get incidet number from Remedy as ack.So you can use that incident number in ur URL to open Remedy.

     

    Its better to use IBRSD only.

     

    Let me know your response.