Try our conversational search powered by Generative AI!

Shahram Shahinzadeh
Apr 26, 2010
  6196
(0 votes)

Catch Monitoring Event inside CMS

Catch Monitoring Event inside CMS

With EPiSrever MirroringMonitoringModule you can easily catch monitoring events and build your application on it. The MirroringMonitoringModule is an http module that works as subscriber to the Monitoring server and caches monitoring events. The size of cache is by default 1000 per mirroring channel and it can be changed by mirroringMonitoringMaxDataPerJob attribute on sitesettings element. You can even listen on the Monitoring server status. Today there is already an Ajax application inside CMS which uses this module you can find it in Admin mode, Config, Mirroring, Mirroring Settings and Monitoring tab.

How can I access it by code?

Before go through the code you need configure Monitoring module and WCF Communication.
Add Monitoring module to webconfig file like

   1: <modules runAllManagedModulesForAllRequests="true">     
   2:      <add name="MonitoringModule" type="EPiServer.MirroringService.MirroringMonitoring.MirroringMonitoringModule, EPiServer.Enterprise"      preCondition="managedHandler"/> 
   3: </modules>
   4:  

 

Add Client endpoint for Monitoring Server.

   1: <system.serviceModel>          
   2:     <client>
   3:      <endpoint
   4:          name = "mirroringMonitoringEndPoint" // The name should not be changed
   5:          address = "http://MirroringSite:port/MirroringMonitoringserver.svc"
   6:          binding = "wsDualHttpBinding" 
   7:          bindingConfiguration = "MonitoringMirroringBinding" 
   8:          contract = "EPiServer.MirroringService.MirroringMonitoring.IMirroringMonitoringEventSystem"/>     
   9:     </client>
  10:     <behaviors>
  11:       <serviceBehaviors>
  12:                   <behavior name="DebugServiceBehaviour">
  13:          <serviceDebug includeExceptionDetailInFaults="true" />
  14:        </behavior>
  15:       </serviceBehaviors>
  16:     </behaviors>
  17:     <bindings>
  18:      <wsDualHttpBinding>
  19:        <binding 
  20:             name="MonitoringMirroringBinding"        
  21:             maxReceivedMessageSize="20000000">
  22:               <security mode="None"/>
  23:        </binding>
  24:      </wsDualHttpBinding>
  25:     </bindings>
  26:   </system.serviceModel>
  27:  

There are two static event handlers on the MirroringMonitoringModule module ServieConnectionEventHandler and MirroringTransferStatusEventHandler.
If you are interested on mirroring monitoring events you can use the MirrorngTransferStatusEventHandler. See code example blow.

   1: MirroringMonitoringModule.MirroringTransferStatusEventHandler += new MirroringStatusEventHandler(MyMonitoringEventHandler); 
   2: static MyMonitoringEventHandler(MirroringStatusEventArgs e)
   3: {    
   4:   // add code to process monitoring event 
   5: }

And If you like to know about the monitoring service status such as if the service is connected, disconnected or in error state. See the code example blow.

   1: MirroringMonitoringModule.ServiceConnectionEventHandler += new ServiceConnectionEventHandler(MyServiceConnectionEventHandler); 
   2: static MyServiceConnectionEventHandler() 
   3: { 
   4:   // Add code to handle monitoring server status 
   5: }
   6:   

 

Apr 26, 2010

Comments

Please login to comment.
Latest blogs
The A/A Test: What You Need to Know

Sure, we all know what an A/B test can do. But what is an A/A test? How is it different? With an A/B test, we know that we can take a webpage (our...

Lindsey Rogers | Apr 15, 2024

.Net Core Timezone ID's Windows vs Linux

Hey all, First post here and I would like to talk about Timezone ID's and How Windows and Linux systems use different IDs. We currently run a .NET...

sheider | Apr 15, 2024

What's new in Language Manager 5.3.0

In Language Manager (LM) version 5.2.0, we added an option in appsettings.json called TranslateOrCopyContentAreaChildrenBlockForTypes . It does...

Quoc Anh Nguyen | Apr 15, 2024

Optimizely Search & Navigation: Boosting in Unified Search

In the Optimizely Search & Navigation admin view, administrators can set a certain weight of different properties (title, content, summary, or...

Tung Tran | Apr 15, 2024