Пример #1
0
        protected override void InternalRun()
        {
            AmServerName serverName = new AmServerName(base.ServerName);

            if (DagHelper.IsNodeClustered(serverName))
            {
                if (!IgnoreTransientErrors.HasPassed(base.GetDefaultErrorKey(typeof(ClusterRpcCheck))))
                {
                    ExTraceGlobals.HealthChecksTracer.TraceDebug <string>((long)this.GetHashCode(), "ClusterRpcCheck didn't pass! Skipping check {0}.", base.Title);
                    base.Skip();
                }
                if (this.m_fClusterLevelCheck)
                {
                    this.RunCheck();
                    return;
                }
                using (IEnumerator <AmServerName> enumerator = this.Cluster.EnumerateNodeNames().GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        AmServerName amServerName = enumerator.Current;
                        try
                        {
                            if (this.IsNodeMemberOfDag(amServerName, this.m_dag))
                            {
                                using (IAmClusterNode amClusterNode = this.Cluster.OpenNode(amServerName))
                                {
                                    if (this.RunIndividualCheck(amClusterNode))
                                    {
                                        base.ReportPassedInstance();
                                    }
                                    continue;
                                }
                            }
                            ExTraceGlobals.HealthChecksTracer.TraceDebug <string, string>((long)this.GetHashCode(), "Cluster node {0} is not a member of DAG {1} so check will not run here.", amServerName.NetbiosName, this.m_dag.Name);
                        }
                        finally
                        {
                            base.InstanceIdentity = null;
                        }
                    }
                    return;
                }
            }
            ExTraceGlobals.HealthChecksTracer.TraceDebug <string>((long)this.GetHashCode(), "Local machine is not clustered! Skipping check {0}.", base.Title);
            base.Skip();
        }
Пример #2
0
        protected override void InternalRun()
        {
            AmServerName serverName = new AmServerName(base.ServerName);

            if (DagHelper.IsNodeClustered(serverName))
            {
                try
                {
                    this.m_Cluster = AmCluster.OpenByName(serverName);
                    if (this.m_Cluster == null)
                    {
                        base.Fail(Strings.CouldNotConnectToCluster(base.ServerName));
                    }
                    return;
                }
                catch (ClusterException ex)
                {
                    base.Fail(Strings.CouldNotConnectToClusterError(base.ServerName, ex.Message));
                    return;
                }
            }
            ExTraceGlobals.HealthChecksTracer.TraceDebug <string, string>((long)this.GetHashCode(), "Server {1} is not clustered! Skipping check {0}.", base.Title, base.ServerName);
            base.Skip();
        }