Beispiel #1
0
        public string GetEventMessage(bool appendMachineInfo)
        {
            if (this.m_EventMessages.Count == 0)
            {
                ExTraceGlobals.HealthChecksTracer.TraceDebug((long)this.GetHashCode(), "GetEventMessageForMom(): No events were logged. m_EventMessages.Count = 0");
                return(null);
            }
            if (!this.m_EventInfo.ShouldBeRolledUp && this.IsMomEvent)
            {
                return(this.m_EventMessages[0]);
            }
            StringBuilder stringBuilder = new StringBuilder();

            if (this.m_EventMessages.Count == 1)
            {
                stringBuilder.AppendLine(this.m_EventMessages[0]);
            }
            else
            {
                foreach (string value in this.m_EventMessages)
                {
                    stringBuilder.AppendLine(value);
                }
            }
            StringBuilder stringBuilder2 = new StringBuilder();

            if (!appendMachineInfo)
            {
                StringBuilder   stringBuilder3   = stringBuilder2;
                string          format           = "{0}{1}{2}";
                LocalizedString?baseEventMessage = this.m_EventInfo.BaseEventMessage;
                stringBuilder3.AppendFormat(format, (baseEventMessage != null) ? baseEventMessage.GetValueOrDefault() : string.Empty, Environment.NewLine, stringBuilder.ToString());
            }
            else
            {
                StringBuilder   stringBuilder4    = stringBuilder2;
                string          format2           = "{0} {1}{2}{3}";
                object[]        array             = new object[4];
                object[]        array2            = array;
                int             num               = 0;
                LocalizedString?baseEventMessage2 = this.m_EventInfo.BaseEventMessage;
                array2[num] = ((baseEventMessage2 != null) ? baseEventMessage2.GetValueOrDefault() : string.Empty);
                array[1]    = TestReplicationHealth.GetMachineConfigurationString(ReplicationCheckGlobals.ServerConfiguration);
                array[2]    = Environment.NewLine;
                array[3]    = stringBuilder.ToString();
                stringBuilder4.AppendFormat(format2, array);
            }
            return(stringBuilder2.ToString());
        }
 private void CheckIfTaskCanRun()
 {
     base.WriteVerbose(TestReplicationHealth.GetMachineConfigurationString(this.m_serverConfigBitfield));
     if (this.AreConfigBitsSet(ServerConfig.Stopped))
     {
         this.WriteWarning(Strings.DagMemberStopped(this.m_serverName));
     }
     if (this.AreConfigBitsSet(ServerConfig.DagMemberNoDatabases))
     {
         this.WriteWarning(Strings.DagMemberNoDatabases(this.m_serverName));
     }
     if (this.IsServerStandaloneWithNoReplicas())
     {
         this.WriteWarning(Strings.StandaloneMailboxNoReplication(this.m_serverName));
     }
 }