9 Replies Latest reply on Jun 6, 2020 12:16 AM by Roland Pocek

    Rule not sending email

    Alvaro Paronuzzi
      Share This:

      Hello everyone,

       

      I wrote an MRL rule for sending an email when an IBRSD_ERROR events arrives to the TSIM cell but, for some reason, it is failing.

      I had written a similar rule in the past and it was working fine. :-(

       

      Here's the rule:

       

      execute sklNotifyIBRSDErrors: IBRSD_ERROR($E)

      where [$E.status == OPEN]

      when $E.severity != OK 

      {

            $LOC = action_locale();

          

            #PREPRO

            concat (['New IBRSD ERROR event in PREPRO - Event ID: ',$E.event_handle,' | Related Ev ID: ',$E.mc_relation_source], $SUBJ);

            #PROD

            #concat (['New IBRSD ERROR event in PROD - Event ID: ',$E.event_handle,' | Related Ev ID: ',$E.mc_relation_source], $SUBJ);

          

              execute($E,mc_sendmail,[

              '-mp','Yes',

              '-ft',localize(kb,$LOC,[MAIL_To]),'<my_mailbox>',

              '-ff',localize(kb,$LOC,[MAIL_From]),'<truesight_mailbox>',

              '-fd',localize(kb,$LOC,[MAIL_Date]),$E.date_reception,

              '-fs',localize(kb,$LOC,[MAIL_Subject]),$SUBJ,

              '-fm',localize(kb,$LOC,[MAIL_Msg]),$E.msg,

              '-fr',localize(kb,$LOC,['ENUM.SEVERITY']),$E.severity,

              '-fa',localize(kb,$LOC,['ENUM.STATUS']),$E.status,

              '-fc',localize(kb,$LOC,['SLOT.CORE_EVENT.CLASS']),$E.CLASS]

              ,YES,NO);

            

              opadd($E,'','Event notified via email',''); 

      }

      END

       

      The MC_CELL_ACTION_RESULT event created after the rule execution says that the exit code of the action is not 0:

      exit=-1073741819;

       

      I have attached the log file and the baroc of the events.

       

      I would really appreciate your help in finding what is causing the error.

       

      Thanks and Regards,

      Alvaro Paronuzzi

        • 1. Re: Rule not sending email
          Philippe Plomteux

          It is an executable, not a TrueSight issue in my opinion.

          The script is called with what seem to be the right arguments.

           

          Are you using the very old mc_sendmail.exe ? i just tried to run it on my Windows 10 and it does not run because of missing DLLs - error code is -1073741515, not so far from yours...

          Have you tried to run the script manually from the CLI ? What is the outcome ?

          1 of 1 people found this helpful
          • 2. Re: Rule not sending email
            Alvaro Paronuzzi

            Hi Philippe,

             

            I tried to run the command manually but it fails. These are a couple of examples as per the suggested usage of the mc_sendmail executable:

             

            USAGE 1: mc_sendmail -ft <ToLabel> <ToAddress> [-fm <MsgLabel> <Msg>] [-fd <DateLabel> <Date>] [-ff <FromLabel> <FromAddress>] [-fs <SubjectLabel> <Subject>] [-fa <StatusLabel> <Status>] [-fr <SeverityLabel> <Severity>] [-fc <ClassLabel> <Class>] [-mp <NO|YES|ON|OFF>] [-v]

             

            My attempt:

            mc_sendmail.exe -ft APA <my_mailbox> -fm MSG Messaggio1 -fd DATE 1589978403 -ff TSOM <truesight_mailbox> -fs SUBJ Oggetto1 -fa STATUS OPEN -fr SEVERITY WARNING -fc CLASS IBRSD_ERROR -mp NO -v

             

            USAGE 2: mc_sendmail <ToAddress> [<Msg> <Date> <POMEnabledFlag=Yes|No> <FromAddress> <Subject> -v]

             

            My attempt:

            E:\Program Files\BMC Software\TrueSight\pw\server\bin>mc_sendmail.exe <my_mailbox> Messaggio1 1589978403  P

            OMEnabledFlag=Yes <truesight_mailbox> Oggetto1 -v

            # of input arguments = 8

            argv[0] = [mc_sendmail.exe]

            argv[1] = [<my_mailbox>]

            argv[2] = [Messaggio1]

            argv[3] = [1589978403]

            argv[4] = [POMEnabledFlag=Yes]

            argv[5] = [<truesight_mailbox>]

            argv[6] = [Oggetto1]

            argv[7] = [-v]

             

            In both cases (but I made multiple attempts slightly modifying the commands) the process crashed with the following error:

             

             

            Problem signature:

              Problem Event Name:    APPCRASH

              Application Name:    mc_sendmail.exe

              Application Version:    0.0.0.0

              Application Timestamp:    5a9ee5bc

              Fault Module Name:    mc_sendmail.exe

              Fault Module Version:    0.0.0.0

              Fault Module Timestamp:    5a9ee5bc

              Exception Code:    c0000005

              Exception Offset:    000000000000a074

              OS Version:    6.3.9600.2.0.0.272.7

              Locale ID:    2057

              Additional Information 1:    5ec1

              Additional Information 2:    5ec1050745d7b159a5f9a257106444e2

              Additional Information 3:    8825

              Additional Information 4:    882533b4d2fa4a52aaa99d1e789f2b5c

             

             

            Thank you in advance for your help.

            Regards,

             

            Alvaro

            • 3. Re: Rule not sending email
              Roland Pocek

              hi Alvaro Paronuzzi

               

              i would open a support ticket and pls update the thread with the outcome, did you also try the pw test_email command to see if everything is basically working? or then try to use event rules in TSIM gui?

               

              pw test _email - Documentation for BMC TrueSight Infrastructure Management 11.3 - BMC Documentation

               

              cheers

              rop

              1 of 1 people found this helpful
              • 4. Re: Rule not sending email
                Alvaro Paronuzzi

                Hi Roland Pocek,

                Thank you for sharing this documentation page. I ran the pw test_email command and it's working fine. The output was the expected one and the email was received.

                 

                There may be something wrong in the parameters I'm passing to the mc_sendmail in the rule, but I am missing it. I tried launching the command manually as per the two usages mentioned in the "help" of this command but I'm still getting errors.

                 

                Do you have an example of a working mc_sendmail command?

                 

                I had developed a similar rule in the past and it was working, so I really don't know what may be wrong with this new one instead.

                 

                Thanks and Regards,

                Alvaro

                • 5. Re: Rule not sending email
                  Roland Pocek

                  Alvaro Paronuzzi there is a remote action where you can trigger to send an email, does that help? i dont have the time to test this right now, i am sorry

                   

                  its in the ..\kb\bin\mc_actions.mrl file

                   

                  execute($E,mc_sendmail,[

                          '-mp',$POM_ENABLED,

                          '-ft',localize(kb,$LOC,[MAIL_To]),$SENDTOUSR,

                          '-ff',localize(kb,$LOC,[MAIL_From]),$FROMUSR,

                          '-fd',localize(kb,$LOC,[MAIL_Date]),$DISPLAY_DATE,

                          '-fs',localize(kb,$LOC,[MAIL_Subject]),$LOC_SUBJ,

                          '-fm',localize(kb,$LOC,[MAIL_Msg]),$E.msg,

                          '-fr',localize(kb,$LOC,['ENUM.SEVERITY']),$LOC_SEV,

                          '-fa',localize(kb,$LOC,['ENUM.STATUS']),localize(kb,$LOC,[$VAL_STAT]),

                          '-fc',localize(kb,$LOC,['SLOT.CORE_EVENT.CLASS']),localize(kb,$LOC,[$VAL_CLS])

                          ],YES,NO);

                   

                  cheers rop

                  • 6. Re: Rule not sending email
                    Roland Pocek

                    but what you also can try is uisng notification policy or event rules in TSIM to send email, if doing so you maybe need this

                     

                    Failed to send email to XXXX. Reason :334 VXNlcm5hbWU6" or "authentication failed" or "No authentication mechanisms supported by both server and client" when trying to send an email from BPPM/TSIM

                     

                     

                    cheers

                    • 7. Re: Rule not sending email
                      Alvaro Paronuzzi

                      Roland Pocek Yes, it's the same remote action I am calling in my rule.

                      I raised a case to the customer support and we found the following error when testing the smail executable (used by mc_sendmail):

                       

                      smail.exe "email" -t "alvaro.paronuzzi@xxxx.it"  -s "test smail" -body "This is Email body"

                      Blat v2.6.2 w/GSS encryption (build : Feb 25 2007 12:06:19)

                       

                      Error: Can't connect to server (timed out if winsock.dll error 10060)

                       

                      I investigated the error with the system admin team but it seems it doesn't depend on the antivirus nor the firewall.

                       

                      The mc_sendmail has been working since a few months ago and in my opinion the only changes that may be causing its failure now are the installation of the most recent hotfixes for 10.7 and the installation of the OS minor updates on the vm.

                       

                      No problem when using the JavaMail API to send email instead (e.g. used by the "pw test_mail" command).

                       

                      Thank you in advance for your help.

                       

                      Alvaro Paronuzzi

                      1 of 1 people found this helpful
                      • 8. Re: Rule not sending email
                        Alvaro Paronuzzi

                        Quick update:

                         

                        In the test environment I am still seeing the same communication issue and it's being investigated by the network admin team.

                         

                        In the production environmet the exit code returned by the action was "exit code = 12".

                        I read this KA and found there was an error in one of the entries of the registry. I could easily fix it correcting the wrong value (typo in the email sender's address). The rule is working fine now.

                         

                        Hopefully after the resolution of the communication issue it will be working also in the test environment.

                         

                        Al

                        2 of 2 people found this helpful
                        • 9. Re: Rule not sending email
                          Roland Pocek

                          thanks for letting us know Alvaro Paronuzzi