6 Replies Latest reply on Nov 28, 2017 3:33 AM by Kaushik KM

    incident creation using execute function not working

    Shweta Rathi

      We have written Perl script which will be used for integration true sight with SNOW .When i an running script manually its working fine creating incident as well.

       

      For executing batch script which is calling Perl script ,we have written  one rule with execute function to invoke  batch script by every alert that should be auto ticketed as well.

       

      I am able to compile rule as well successfully.(FYI we have kept perl script and batch script under E:\BMC Software\TSIMAgent\RemoteCell\Agent\server\etc\TS_SNOW\kb\bin\w) and Rule is residing on same server under E:\BMC Software\TSIMAgent\RemoteCell\Agent\server\etc\TS_SNOW\kb\rules)

       

      MRL code is shown below

      execute trigger_snow_ticket: EVENT($EV)

      where [$EV.severity >= MINOR ]

      when $EV.status within [OPEN,ACK]

      {

      execute($EV,trigger_snowtic,[],YES);

      }

      END

       

       

      The above events are getting propagated from True sight to another BEM Cell which is suppose to generate incident for new events,which is not happening.Need assistance and would like to understand whether the MRL code has problem ,why its not invoking batch script automatically.

       

      Regards,

      Shweta

        • 1. Re: incident creation using execute function not working
          Kaushik KM

          Hi Shwetha,

          I am not really sure if you have already tried this:

          check this out:

           

          ########################################################################################################################

          execute myperl: EVENT($EV)

          where [$EV.mc_host == 'yourserver']

          when $EV.status == OPEN

               {

          $path ="D:\Program Files\BMC Software\ProactiveNet\pw\server\etc\mycell\kb\bin\w4\callmyperl.cmd";

               execute($EV, $path, [$EV.mc_host], NO);  

               }

          END

           

          (i meant to show the path defined here, ECF depends on you)

           

           

          ########################################################################################################################

           

           

          ########################################################################################################################

          in the batch file i am calling & passing the values as shown below :

           

           

          @ECHO OFF

          call "<perl.exe path>" "<your perl script path>"  --host=%mc_host% --severity=%severity% --service=%mc_service% --client=us --host_alias=%mc_smc_alias% --host_address=%mc_tool_address% --timestamp=%date_reception% --attributes="%mc_long_msg%" --info="%msg%" --server=XXXXXX --source_id=%mc_ueid%

          ########################################################################################################################

          <perl.exe path> ex - "C:\perl64\bin\perl.exe"

          <your perl script path> ex - "D:\Program Files\BMC Software\ProactiveNet\pw\server\etc\mycell\kb\bin\w4\PERL_SCRIPT\simpleperl.pl"

           

          ########################################################################################################################

           

          Please let me know if this helps

          "when $EV.status within [OPEN,ACK]" - are you sure about using this?

           

          Regards,

          Kaushik KM

          • 2. Re: incident creation using execute function not working
            Shweta Rathi

            Thanks Kaushik,I tried the steps mentioned by you but no luck☹

             

            Regards,

            Shweta

            • 3. Re: incident creation using execute function not working
              Shweta Rathi

              Thanks .Kaushik made couple of more changes to script and it worked…

               

              Regards,

              Shweta

              • 4. Re: incident creation using execute function not working
                Kaushik KM

                Hi Shweta Rathi

                Great !

                1)Could you please elaborate on changes made? was the changes made in your perl script? then how was it not triggered initially?

                2)Also in your MRL i see the line

                "when $EV.status within [OPEN,ACK]"

                 

                the above line means, the script will be triggered when the response team acknowledge the event in the console or what does it mean?

                1 of 1 people found this helpful
                • 5. Re: incident creation using execute function not working
                  Shweta Rathi

                  Hi Kaushik,

                   

                  Yep you are right, I have removed this content from MRL ,Below is the mRl which I am using now. Apart from this I also added he path of Perl script to batch file as suggested by you.

                   

                   

                  execute myperl: EVENT($EV)

                  where

                  when $EV.status == OPEN

                       {

                  $path ="E:\BMC Software\TSIMAgent\RemoteCell\Agent\server\etc\TS_SNOW\kb\bin\w\TruesightSNOW.bat";

                       execute($EV, $path, , NO);

                       }

                  END

                  • 6. Re: incident creation using execute function not working
                    Kaushik KM

                    Hi Shwetha,

                    Great that it worked!!

                     

                    Here is link of another similar situation :

                    https://communities.bmc.com/message/727621#727621

                    Hope it helps.

                    1 of 1 people found this helpful