简体   繁体   English

监视SSRS订阅错误

[英]Monitor SSRS Subscription Errors

Using SSRS 2012, we utilize report subscriptions to save reports network locations and send reports by email. 使用SSRS 2012,我们利用报告订阅来保存报告网络位置并通过电子邮件发送报告。 I am familiar with how to debug errors, but I am looking for a solution to alert our support team when a subscription has failed to send. 我熟悉如何调试错误,但是我正在寻找一种解决方案,以在订阅发送失败时提醒我们的支持团队。 Call me crazy for being proactive. 称我为主动很疯狂。

I see a solution to monitor the ReportServer tables for status, but it assumes all subscriptions are by email (only handles email statuses) . 我看到了一种监视ReportServer表状态的解决方案,但是它假定所有订阅都是通过电子邮件进行的(仅处理电子邮件状态)

I also see the execution log table(ExecutionLog3), but the table doesn't appear to capture all errors. 我还看到了执行日志表(ExecutionLog3),但该表似乎无法捕获所有错误。 I forced a subscription to fail by removing network access to the file location, but the error doesn't appear in the table. 我通过删除对文件位置的网络访问来强制订阅失败,但是该错误未出现在表中。

I would like to write an SSRS report which can be run to view all subscription errors that have occurred for a day. 我想编写一个SSRS报告,可以运行该报告来查看一天中发生的所有订阅错误。 Any suggestions are appreciated. 任何建议表示赞赏。

This does only handle the last status message so doesn't fully answer the question (I came across this post because I am looking for the same answer), but it does seem to work for me in terms of catching all subscription errors, including file share issues: 这只会处理最后一条状态消息,因此无法完全回答问题(我遇到了此帖子,因为我正在寻找相同的答案),但是它对于捕获所有订阅错误(包括文件)似乎确实对我有用分享问题:

select count(*) 
from ReportServer.dbo.[Subscriptions] S 
where 0 = case 
          when S.[LastStatus] = 'New Subscription' then 1 
          when substring(S.[LastStatus],1,9) = 'Mail Sent' then 1 
          when substring(S.[LastStatus],1,5) = 'Done:' 
           and right(S.[LastStatus],9) = '0 errors.' then 1 
          when substring(S.[LastStatus],1,9) = 'The file ' 
           and patindex('%has been saved to the%',S.[LastStatus]) > 1 
           and right(S.[LastStatus],11) = 'file share.' then 1 
          else 0 
      end

I have used Report Server Diagnostic Reports pack from Microsoft 我已经使用了Microsoft的Report Server Diagnostic Reports Pack

More info about the Report Server Diagnostic Reports (snapshots) 有关报表服务器诊断报告(快照)的更多信息

Download link for Report Server Diagnostic Reports Pack 下载报告服务器诊断报告包的链接

I have not used this but i have heard about it 我没有用过,但是我听说过

Free SQL Monitor SSRS Reporting Pack 免费的SQL Monitor SSRS报告包

There is no built in way to do this. 没有内置的方法可以做到这一点。 You will have to parse the Windows error log or the reporting services log. 您将必须解析Windows错误日志或Reporting Services日志。 I have not tried this but the ssrs api might return the last subscription status for subscription based reports, however there is not historical log outside of the ReportingService database and even there I am not sure if failures are logged. 我没有尝试过,但是ssrs api可能会返回基于订阅的报告的最新订阅状态,但是ReportingService数据库之外没有历史日志,甚至我也不确定是否记录了失败。

Check out this solution I found on Jeff Prom's blog, http://jeffprom.com/2008/08/22/ssrs-failed-subscription-notifications/ 看看我在Jeff Prom的博客http://jeffprom.com/2008/08/22/ssrs-failed-subscription-notifications/上找到的解决方案

SELECT C.Name, S.LastRunTime, S.LastStatus, S.Description
 FROM Subscriptions AS S
 LEFT OUTER JOIN [Catalog] AS C
 ON C.ItemID = S.Report_OID
 WHERE LEFT (S.LastStatus, 12) != ‘Mail sent to’
   AND LEFT (S.LastStatus, 12) != ‘New Subscrip’

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM