Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Shahram Shahinzadeh
Apr 26, 2010
  6209
(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
Solving the mystery of high memory usage

Sometimes, my work is easy, the problem could be resolved with one look (when I’m lucky enough to look at where it needs to be looked, just like th...

Quan Mai | Apr 22, 2024 | Syndicated blog

Search & Navigation reporting improvements

From version 16.1.0 there are some updates on the statistics pages: Add pagination to search phrase list Allows choosing a custom date range to get...

Phong | Apr 22, 2024

Optimizely and the never-ending story of the missing globe!

I've worked with Optimizely CMS for 14 years, and there are two things I'm obsessed with: Link validation and the globe that keeps disappearing on...

Tomas Hensrud Gulla | Apr 18, 2024 | Syndicated blog

Visitor Groups Usage Report For Optimizely CMS 12

This add-on offers detailed information on how visitor groups are used and how effective they are within Optimizely CMS. Editors can monitor and...

Adnan Zameer | Apr 18, 2024 | Syndicated blog