13 Replies Latest reply: Jun 1, 2017 3:34 PM by Kevin Case RSS

    Qlik Sense Task Failure Notifications

    Monica Labrador

      Hi,

       

      Is there a verifiable solution for configuring task failure notifications/emails? I have seen a few posts about this in the past, but haven't come across anyone having success.

        • Re: Qlik Sense Task Failure Notifications
          Barry Stevens

          I asked this a couple of days ago and this was the response...

           

          Task Failure notifications

           

          Seems not an out of the box solution and to utilise Qlik Branch solutions (see answers to my Question)

          Appears to be a common request - hopefully added to a release soon

           

          Barry

          • Re: Qlik Sense Task Failure Notifications
            Kevin Case

            Monica,

             

            There is an out of the box solution for this!  Re: Alerts in Qlik Sense

             

            You can use the SMTPAppender to do this.  The link above gives an example of how to implement this.  I was able to configure this on both our test and production environments.  And it works great.

             

            Search the community or Qlik Help for SMTPAppender

              • Re: Qlik Sense Task Failure Notifications
                Monica Labrador

                Hi Kevin,

                Thank you for your reply, and I am glad to hear that you got the notifications to work! I searched through the community for smtp appender discussions and stumbled across a few that you have been a part of. , I am new to Qlik Sense/developing. so, a lot of the information went over my head. Would you be able to help outline the steps that I would need to go through to get this configured (this will help others searching for the same solution)? I appreciate your help!

              • Re: Qlik Sense Task Failure Notifications
                Barry Stevens

                now i am following this with interest

                  • Re: Qlik Sense Task Failure Notifications
                    Kevin Case

                    Monica,

                     

                    Here are the steps:

                     

                    1. Open Notepad or some other editor and copy the following xml code:

                     

                    <?xml version="1.0"?>

                    <configuration>

                    <!-- Mail appender-->

                    <appender name="MailAppender" type="log4net.Appender.SmtpAppender">

                      <filter type="log4net.Filter.StringMatchFilter">

                        <param name="stringToMatch" value="ReloadResult" />

                        <param name="acceptOnMatch" value="false" />

                      </filter>

                      <filter type="log4net.Filter.LevelRangeFilter">

                        <param name="levelMin" value="ERROR" />

                      </filter>

                      <filter type="log4net.Filter.DenyAllFilter" />

                      <evaluator type="log4net.Core.LevelEvaluator">

                        <param name="threshold" value="ERROR"/>

                      </evaluator>

                      <param name="to" value="kevin@MyEmail.com" />

                      <param name="from" value="Qlik@MyQlikServer.com" />

                      <param name="subject" value="Qlik Job Failure" />

                      <param name="smtpHost" value="MySMTPAddress" />

                      <param name="port" value="25" />

                      <param name="bufferSize" value="0" /> <!-- Set this to 0 to make sure an email is sent on every error -->

                      <param name="lossy" value="true" />

                      <layout type="log4net.Layout.PatternLayout">

                        <param name="conversionPattern" value="%newline%date %-5level %newline%property{TaskName}%newline%property{AppName}%newline%message%newline%newline%newline" />

                      </layout>

                    </appender>

                    <!--Send mail on task failure-->

                    <logger name="System.Scheduler.Scheduler.Slave.Tasks.ReloadTask">

                      <appender-ref ref="MailAppender" />

                    </logger>

                    </configuration>

                    </configuration>

                     

                    1. Modify Line 16. This should be the email address of who will receive the email.  Probably your email address.
                    2. Modify line 17. This should be set to who is sending the email.
                    3. Modify line 19. Set this value to the SMTP host used to send email.  Your network admin should be able to supply you with this information.
                    4. Modify Line 20. Set this to the correct SMPT Port. This should also be supplied by your network admin.
                    5. Save the file with the following name: LocalLogConfig.xml
                    6. You then need to copy this file to your Qlik Sense server Scheduler folder.  The location of this file is important.  For me, I have a straightforward installation so my files are installed in the default locations.   This is my location for the Scheduler folder: c:\ProgramData\Qlik\Sense\Scheduler

                        

                    Now, whenever you have a job failure, an email will be sent to the recipient.

                     

                      • Re: Qlik Sense Task Failure Notifications
                        Bill Markham

                        Kevin

                         

                        Many thanks for posting that - I'll give it a go.

                        • Re: Qlik Sense Task Failure Notifications
                          Edgar Kech

                          kevincase : followed your instructions, but it still doesn't work. Do we need to restart some services? (which one?)

                            • Re: Qlik Sense Task Failure Notifications
                              Kevin Case

                              Edgar,

                               

                              Not sure if you ever got this working.  Sorry for the delay.  You can restart the scheduler service but I do not believe that it is a requirement.

                               

                              Validate that the file location and name are correct.  Also make sure you do not have any restrictions sending email from the Qlik server.  Many times for security purposes, ports may be closed or sending email to/from a particular address is prohibited from the server.

                               

                              This is supported by Qlik so if you are unable to get it to function, you should be able to open a support ticket.

                               

                              Kevin

                              • Re: Qlik Sense Task Failure Notifications
                                Elizabeth Bamber

                                Hi Edgar

                                If you are still looking at this I got this working by making a very minor tweak to the XML to simply remove the duplicated last line "</configuration>" in larger font .

                                Thanks to Kevin for this info.

                                  • Re: Qlik Sense Task Failure Notifications
                                    Kevin Case

                                    Elizabeth,

                                     

                                    Sorry about the typographical error.  I must have done the Copy/Paste incorrectly.

                                     

                                    To all:  This is what the code should look like but you will still need to follow steps 1 through 6 from above.

                                     

                                    <?xml version="1.0"?>

                                    <configuration>

                                    <!-- Mail appender-->

                                    <appender name="MailAppender" type="log4net.Appender.SmtpAppender">

                                      <filter type="log4net.Filter.StringMatchFilter">

                                        <param name="stringToMatch" value="ReloadResult" />

                                        <param name="acceptOnMatch" value="false" />

                                      </filter>

                                      <filter type="log4net.Filter.LevelRangeFilter">

                                        <param name="levelMin" value="ERROR" />

                                      </filter>

                                      <filter type="log4net.Filter.DenyAllFilter" />

                                      <evaluator type="log4net.Core.LevelEvaluator">

                                        <param name="threshold" value="ERROR"/>

                                      </evaluator>

                                      <param name="to" value="kevin@MyEmail.com" />

                                      <param name="from" value="Qlik@MyQlikServer.com" />

                                      <param name="subject" value="Qlik Job Failure" />

                                      <param name="smtpHost" value="MySMTPAddress" />

                                      <param name="port" value="25" />

                                      <param name="bufferSize" value="0" /> <!-- Set this to 0 to make sure an email is sent on every error -->

                                      <param name="lossy" value="true" />

                                      <layout type="log4net.Layout.PatternLayout">

                                        <param name="conversionPattern" value="%newline%date %-5level %newline%property{TaskName}%newline%property{AppName}%newline%message%newline%newline%newline" />

                                      </layout>

                                    </appender>

                                    <!--Send mail on task failure-->

                                    <logger name="System.Scheduler.Scheduler.Slave.Tasks.ReloadTask">

                                      <appender-ref ref="MailAppender" />

                                    </logger>

                                    </configuration>