Shahram Shahinzadeh
Apr 26, 2010
(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>


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>

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: }


Apr 26, 2010


Please login to comment.
Latest blogs
Translating Optimizely CMS 12 UI components

Optimizely CMS 12 have been out for a while now, but still some elements haven't been properly translated resulting in a GUI defaulting to english....

Eric Herlitz | Jan 26, 2023 | Syndicated blog

Image preview in Optimizely CMS12 all properties view

With these simple steps, you can now see an Image and its Metadata, including size and dimensions, when editing an Image property in Optimizely...

Tomas Hensrud Gulla | Jan 26, 2023 | Syndicated blog

Setting up the ImageEditor in Optimizely CMS 12

Setting up certain configurations on Opimizely CMS 12 differs quite a bit from prior versions of (Episerver CMS 11 and older). Here's a small guide...

Eric Herlitz | Jan 25, 2023 | Syndicated blog

Happy Hour Returning in February

Hi everyone! It's been a while and we're excited to resume our Happy Hour in February for more learning, sharing, connecting, relaxing, and just to...

Patrick Lam | Jan 24, 2023