Try our conversational search powered by Generative AI!

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

Azure AI Language – Abstractive Summarisation in Optimizely CMS

In this article, I show how the abstraction summarisation feature provided by the Azure AI Language platform, can be used within Optimizely CMS to...

Anil Patel | Apr 18, 2024 | Syndicated blog

Fix your Search & Navigation (Find) indexing job, please

Once upon a time, a colleague asked me to look into a customer database with weird spikes in database log usage. (You might start to wonder why I a...

Quan Mai | Apr 17, 2024 | Syndicated blog

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