无法让 HealthMonitoring 工作

发布于 2024-09-28 19:04:52 字数 2498 浏览 2 评论 0 原文

使用asp.net 4.0,一直尝试遵循以下操作:

http://msdn.microsoft.com /en-us/library/ms998306

还尝试使用 eventlogprovider 和邮件提供商。沉默。关于健康监测,有什么我应该知道的吗?就像它在 4.0 中不起作用一样?

目前我的 web.config 看起来像这样:

<healthMonitoring  enabled="true" heartbeatInterval="600">
  <providers>
   <clear/>
   <add name="EmailErrorProvider"
 type="System.Web.Management.SimpleMailWebEventProvider"
 to="[email protected]"
 from="[email protected]"
 buffer="false"
 subjectPrefix="An error has occured."
 bodyHeader="This email is generated from my application." />
   <add connectionStringName="MySqlConnection"
      maxEventDetailsLength="1073741823"
      buffer="true"
      bufferMode="Extra Critical Notification"
      name="MySqlWebEventProvider"
      type="System.Web.Management.SqlWebEventProvider,System.Web,Version=2.0.0 .0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" />
  </providers>
  <rules>
   <clear/>
   <add name="Testing Mail Event Providers"
 eventName="All Errors"
 provider="EmailErrorProvider"
 profile="Default"
 minInstances="1"
 maxLimit="Infinite"
 minInterval="00:01:00"
 custom=""/>
   <add name="Critical event"
     eventName="My Critical Event"
     provider="MySqlWebEventProvider"
     profile="Throttle"/>
  </rules>
  <eventMappings>
   <clear/>
   <add name="All Errors"
 type="System.Web.Management.WebBaseErrorEvent, System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a"
 startEventCode="0"
 endEventCode="2147483647"/>
   <add name="My Critical Event"
     type="MyWebEvents.MyCriticalEvent,MyWebEvents"/>
  </eventMappings>
  <profiles>
   <add name="Throttle"
     minInstances="1"
     maxLimit="1000"
     minInterval="00:00:01"/>
  </profiles>
  <bufferModes>
   <add name="Extra Critical Notification"
     maxBufferSize="10"
     maxFlushSize="5"
     urgentFlushThreshold="1"
     regularFlushInterval="Infinite"
     urgentFlushInterval="00:01:00"
     maxBufferThreads="1"
    />
  </bufferModes>
 </healthMonitoring>

希望有人可以提供帮助。

Using asp.net 4.0, been trying to follow this:

http://msdn.microsoft.com/en-us/library/ms998306

Also tried using eventlogprovider and the mail provider. Silence. Is there anything I should know about healthmonitoring, like it doesn't work in 4.0?

Currently me web.config looks like this:

<healthMonitoring  enabled="true" heartbeatInterval="600">
  <providers>
   <clear/>
   <add name="EmailErrorProvider"
 type="System.Web.Management.SimpleMailWebEventProvider"
 to="[email protected]"
 from="[email protected]"
 buffer="false"
 subjectPrefix="An error has occured."
 bodyHeader="This email is generated from my application." />
   <add connectionStringName="MySqlConnection"
      maxEventDetailsLength="1073741823"
      buffer="true"
      bufferMode="Extra Critical Notification"
      name="MySqlWebEventProvider"
      type="System.Web.Management.SqlWebEventProvider,System.Web,Version=2.0.0 .0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" />
  </providers>
  <rules>
   <clear/>
   <add name="Testing Mail Event Providers"
 eventName="All Errors"
 provider="EmailErrorProvider"
 profile="Default"
 minInstances="1"
 maxLimit="Infinite"
 minInterval="00:01:00"
 custom=""/>
   <add name="Critical event"
     eventName="My Critical Event"
     provider="MySqlWebEventProvider"
     profile="Throttle"/>
  </rules>
  <eventMappings>
   <clear/>
   <add name="All Errors"
 type="System.Web.Management.WebBaseErrorEvent, System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a"
 startEventCode="0"
 endEventCode="2147483647"/>
   <add name="My Critical Event"
     type="MyWebEvents.MyCriticalEvent,MyWebEvents"/>
  </eventMappings>
  <profiles>
   <add name="Throttle"
     minInstances="1"
     maxLimit="1000"
     minInterval="00:00:01"/>
  </profiles>
  <bufferModes>
   <add name="Extra Critical Notification"
     maxBufferSize="10"
     maxFlushSize="5"
     urgentFlushThreshold="1"
     regularFlushInterval="Infinite"
     urgentFlushInterval="00:01:00"
     maxBufferThreads="1"
    />
  </bufferModes>
 </healthMonitoring>

Hope someone can help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

执手闯天涯 2024-10-05 19:04:52

HealthMonitoring 在 4.0 中运行良好。

您可能没有在 web.config 中定义 SMTP 服务器

如果您无法使用本地 SMTP 服务器并且只能通过主机/IP/用户名/密码发送邮件,您可以查看这篇文章:http://www.tomot.de/en-us/article/6/asp.net/how-to-create-a-custom-healthmonitoring-provider-that-sends-e-mails

HealthMonitoring works fine in 4.0.

You probably haven't defined a SMTP server in the web.config

If you can't use a local SMTP server and you can only send mails via host/ip/username/password, you might check out this article: http://www.tomot.de/en-us/article/6/asp.net/how-to-create-a-custom-healthmonitoring-provider-that-sends-e-mails

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文