EPiServer CMS 6.0 / R2
Document last saved:
The Monitoring Server monitors mirroring jobs. As soon as a Mirroring job is started then the Mirroring Source Server sends an event (MirroringStatusEventArgs) for the state changing of the mirroring job to the monitoring Server. A subscriber can follow mirroring states from start to end.
There are 9 different states of a mirroring job which are as follows:
The MirroringStatusEventArgs contains a Guid which is the mirroring job id and a MirroringTransferData. The MirroringTransferData contains MirroringInitializeData, MirroringPackageBody, MirroringPackageHeader and MirroringStatus.
The MirroringInitializeData contains Name, DestinationPageGuid, DestinationPath, DestinationRoot, LastExecution, NrOfFilesinPackage, NrOfPagesInPackages and etc.
The MirroringPackageHeader contains FileSize, TargetFilePath, SizeOfSentData, SizeOfReceiveData.
The MirroringStatus contains MirroringState and StatusLog (contains information about Processing, Warning and Error etc).
There are two monitoring modes, Offline and Online.
The Mirroring Server by default logs all states of a mirroring job as an xml file under “C:\MirroringMonitoringData\”. The filename starts with a unique id and timestamp. In the CTP version this mode is always on, it cannot be configured. The xml file contains a list of MirroringStatusEventArgs.
The Monitoring server sends events to subscribers online.
The Monitoring Server is based on Windows Communication Foundation (WCF) Duplex Communication channel and as with all WCF this can be configured in the config file. By default the Monitoring Server is tightly integrated with the Mirroring Server 2.0 and the installation program configures it by default to use port 80.
By default, the Mirroring installer takes care of the Monitoring Server configuration which is as the blow.
A custom subscriber can use the MirroringMonitoringClient helper class. The subscriber can receive events via the MirroringTransferStatusEventHandler. There is also possibility to subscribe on a specific mirroring job via the Subscribe (Guid contextId) method or for all mirroring jobs via the Subscribe () method.
To make a subscription against the monitoring server, you need only to create an instance of MirroringMonitoringClient endpointName which is defined in app.config.
MirroringMonitoringClient mom = new MirroringMonitoringClient(endPointName); //Client endPointName
To receive Mirroring events or to be notified from the Monitoring Server, the application has to add a handler to the MirroringTransferStatusEventHandler event.
mom.MirroringTransferStatusEventHandler += new MirroringStatusEventHandler(TransferEventCatcher);
The Mirroring 2.0 CTP ships with a simple example Monitoring WinForms application which the user can use to view both online and offline logs.