Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
dana
Creator II
Creator II

Alert for failed tasks - with log4net appender

Hi People,

I'm trying to implement  "SMTP email notification Qlik Sense on task failure" based on the sources published by Christof  Schwarz 

https://www.youtube.com/watch?v=Px4pvSlqK0s 

https://github.com/ChristofSchwarz/qs_log4net_appender

My server version is May 2022.

but, unfortunately, it didn't work.

I did a couple of modifications based on other posts, but, still, with nosuccess.

Regarding smtp.gmail.com:

I defined the port based on my account definition (465). Is that correct?

Is the user name the full mail address?

bellow is the XML I'm using.

Would appreciate some help!

Thanks!

<?xml version="1.0" encoding="UTF-8"?>
<configuration>

<appender name="sendMail" type="log4net.Appender.SmtpAppender">
<evaluator type="log4net.Core.LevelEvaluator">
<param name="threshold" value="error"/>
</evaluator>
<param name="to" value="XXX@gmail.com" />
<param name="from" value="XXX@gmail.com" />
<param name="smtpHost" value="smtp.gmail.com" />
<param name="port" value="465" />
<param name="EnableSsl" value="true" />
<param name="Authentication" value="Basic" />
<param name="username" value="XXX@gmail.com" />
<param name="password" value="XXX" />
<param name="bufferSize" value="0" /> <!-- dont change -->
<param name="lossy" value="true" /> <!-- dont change -->
<param name="subject" value="Qlik Sense Server QSSRV: App reload failed" />
<layout type="log4net.Layout.PatternLayout">
<param name="conversionPattern"
value="You receive this email because of settings for appender 'SendMail1'
in LocalLogConfig.xml in C:\ProgramData\Qlik\Sense\Scheduler%newline%
Date: %date %newline
Task Name: %property{TaskName}%newline
AppName: %property{AppName}%newline
AppId: %property{AppId}%newline
Error Message: %message%newline%newline%newline
To see more go to https://QS1/qmc/tasks?ID=%property{TaskId}" />
</layout>
</appender>

<logger name="System.Scheduler.Scheduler.Slave.Tasks.ReloadTask">
<appender-ref ref="sendMail" />
</logger>
</configuration>

 

 

 

Labels (1)
7 Replies
PadmaPriya
Support
Support

Hi @dana 

 

Please refer to below article for your reference:

https://community.qlik.com/t5/Qlik-Sense-Documents/Sending-e-mail-alerts-in-Qlik-Sense-Enterprise-Ta...

 

Thanks,

Padma Priya

Qlik Support

Help users find answers! Don't forget to mark a solution that worked for you! If already marked, give it a thumbs up!
mountaindude
Partner Ambassador
Partner Ambassador

Using the Log4Net SMTP appender will give you basic emails for ALL failed reload tasks. 

This is a good start, but if you want better/more informative alert emails you need some other solution.
Or if you want alert emails for just some reload tasks, or different recipients for different tasks.

I'm the creator of the Butler open source (free!) tool that offers a pretty comprehensive set of features around failed reload alerting, more info here: https://community.qlik.com/t5/Qlik-Sense-Documents/Sending-e-mail-alerts-in-Qlik-Sense-Enterprise-Ta...

 

Please mark the post as a solution if it provided you with a solution to the topic at hand. Thanks!
dana
Creator II
Creator II
Author

Hi,

Thanks for this helpful link..

I've used the example configuration posted there, but it still doesn't work.

As some people commented there, it might not work with later versions of Sense.

I share their frustration, and hope someone from support, will check and to resolve it.

Thank you! 

dana
Creator II
Creator II
Author

Hi,

Currently,  I need a simple and quick solution, and I'm pretty upset with not being able to get it working..

Does Butler require changing settings of Sense environment?

Thanks!

 

mountaindude
Partner Ambassador
Partner Ambassador


@dana wrote:

Hi,

Currently,  I need a simple and quick solution, and I'm pretty upset with not being able to get it working..

Does Butler require changing settings of Sense environment?

Thanks!

 


Well, this feature isn't really something that Qlik supports. The fact that it's possible at all is more of a bonus feature coming with the fact that Log4Net is used within client-managed Qlik Sense Enterprise.
So I don't think you can hold Qlik liable for setup/configuration related problems.

That said, once set up the Log4Net appenders tend to be very stable and just work.
I know Sense environments that have been using this concept for years without any problems, so it's pretty solid.

Regarding Butler, in it's basic configuration it does not require any changes to Qlik Sense.
The basic configuration here means you will be notified (email, Teams, Slack, webhook, InfluxDB, New Relic, Signl4, MQTT, ...) for all failed reloads.

If you want to control on a per-reload-task basis if a particular task should cause a reload failure alert, you do need to create a new custom property in Sense, and then set that CP for tasks that should result in reload failure alerts. 
If you have hundreds or thousands of tasks you probably want to control which result in alerts and which don't. Maybe different people/teams should be alerted depending on which task fails too.
If you on the other hand have a smaller Sense environment, the standard setup will probably be fine.

Please mark the post as a solution if it provided you with a solution to the topic at hand. Thanks!
dana
Creator II
Creator II
Author

Hi,

Re Qlik's "reliability": well, I would expect a built-in feature for an e-mail alert for a task failure.

Re Butler:

I would appreciate if you'll reference me to the basic configuration: for all failed reloads.

Thanks!

 

 

dana
Creator II
Creator II
Author

Hi,

Hi @mountaindude,

I have customized my XML file,  but still, mails are not sent (Attached below).

I have used the examples you shared , for a basic configuration without Butler:

My question is:

Would I run to the same issue after installing Butler?

I mean, is it something that should be defined in Windows Server?

Thanks!

 

<?xml version="1.0"?>
<configuration>

<appender name="MailAppender" type="log4net.Appender.SmtpAppender">
<filter type="log4net.Filter.StringMatchFilter">
<param name="stringToMatch" value="Message from ReloadProvider" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<evaluator type="log4net.Core.LevelEvaluator">
<param name="threshold" value="ERROR"/>
</evaluator>
<param name="to" value="XXX@gmail.com" />
<param name="from" value="YYY@gmail.com" />
<param name="smtpHost" value="smtp.gmail.com" />
<param name="port" value="587" />
<param name="EnableSsl" value="true" />
<param name="Authentication" value="Basic" />
<param name="username" value="XXX@gmail.com" />
<param name="password" value="ZZZZ" />
<param name="bufferSize" value="0" /> <!-- dont change -->
<param name="lossy" value="true" /> <!-- dont change -->
<param name="subject" value="Qlik Sense Server QS1: App reload failed" />
<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>