Example #1
0
        private DiagnosticMessage TestNetworkShare()
        {
            DiagnosticMessage msg = new DiagnosticMessage()
            {
                EntityName  = this.GetFullyQualifiedName(),
                NetworkName = this.UncPath.ResolvedValue,
                ServiceName = "Network Share"
            };

            try
            {
                Guid g = Guid.NewGuid();

                string path = Path.Combine(
                    this.UncPath.ResolvedValue,
                    String.Format("{0}.txt", g.ToString()));

                using (StreamWriter outfile = File.CreateText(path))
                {
                    outfile.WriteLine("Hello");
                }

                File.Delete(path);

                msg.Status = DiagnosticMessageStatus.OK;
            }
            catch (System.Exception ex)
            {
                msg.Status       = DiagnosticMessageStatus.Error;
                msg.ErrorMessage = ex.Message;
            }

            return(msg);
        }
Example #2
0
        private DiagnosticMessage TestNetworkShare()
        {
            DiagnosticMessage msg = new DiagnosticMessage()
            {
                EntityName = this.GetFullyQualifiedName(),
                NetworkName = this.UncPath.ResolvedValue,
                ServiceName = "Network Share"
            };

            try
            {
                Guid g = Guid.NewGuid();

                string path = Path.Combine(
                    this.UncPath.ResolvedValue,
                    String.Format("{0}.txt", g.ToString()));

                using (StreamWriter outfile = File.CreateText(path))
                {
                    outfile.WriteLine("Hello");
                }

                File.Delete(path);

                msg.Status = DiagnosticMessageStatus.OK;
            }
            catch (System.Exception ex)
            {
                msg.Status = DiagnosticMessageStatus.Error;
                msg.ErrorMessage = ex.Message;
            }

            return msg;
        }
 private void CopyMembers(DiagnosticMessage old)
 {
     this.entityName   = old.entityName;
     this.networkName  = old.networkName;
     this.serviceName  = old.serviceName;
     this.status       = old.status;
     this.errorMessage = old.errorMessage;
 }
Example #4
0
 private void CopyMembers(DiagnosticMessage old)
 {
     this.entityName = old.entityName;
     this.networkName = old.networkName;
     this.serviceName = old.serviceName;
     this.status = old.status;
     this.errorMessage = old.errorMessage;
 }
        private DiagnosticMessage TestSqlConnection()
        {
            DiagnosticMessage msg = new DiagnosticMessage()
            {
                EntityName = GetFullyQualifiedName(),
                NetworkName = Federation.SchemaSourceServerInstance.GetCompositeName(),
                ServiceName = "SQL Connection to Schema Source Server"
            };

            ServerInstance.RunDiagnostics(GetConnectionString().ConnectionString, msg);

            return msg;
        }
        private DiagnosticMessage TestSqlConnection()
        {
            DiagnosticMessage msg = new DiagnosticMessage()
            {
                EntityName = GetFullyQualifiedName(),
                NetworkName = GetCompositeName(),
                ServiceName = "SQL Connection"
            };

            Util.RunSqlServerDiagnostics(GetConnectionString().ConnectionString, msg);

            return msg;
        }
        private DiagnosticMessage TestSqlConnection()
        {
            DiagnosticMessage msg = new DiagnosticMessage()
            {
                EntityName  = GetFullyQualifiedName(),
                NetworkName = Federation.SchemaSourceServerInstance.GetCompositeName(),
                ServiceName = "SQL Connection to Schema Source Server"
            };

            ServerInstance.RunDiagnostics(GetConnectionString().ConnectionString, msg);

            return(msg);
        }
Example #8
0
        private DiagnosticMessage TestSqlConnection()
        {
            DiagnosticMessage msg = new DiagnosticMessage()
            {
                EntityName  = GetFullyQualifiedName(),
                NetworkName = GetCompositeName(),
                ServiceName = "SQL Connection"
            };

            RunDiagnostics(GetConnectionString().ConnectionString, msg);

            return(msg);
        }
Example #9
0
        internal static void RunDiagnostics(string connectionString, DiagnosticMessage message)
        {
            var csb = new SqlConnectionStringBuilder(connectionString);
            csb.ConnectTimeout = 5;

            try
            {
                using (SqlConnection cn = new SqlConnection(csb.ConnectionString))
                {
                    cn.Open();
                    cn.Close();
                }

                message.Status = DiagnosticMessageStatus.OK;
            }
            catch (System.Exception ex)
            {
                message.Status = DiagnosticMessageStatus.Error;
                message.ErrorMessage = ex.Message;
            }
        }
Example #10
0
        internal static void RunDiagnostics(string connectionString, DiagnosticMessage message)
        {
            var csb = new SqlConnectionStringBuilder(connectionString);

            csb.ConnectTimeout = 5;

            try
            {
                using (SqlConnection cn = new SqlConnection(csb.ConnectionString))
                {
                    cn.Open();
                    cn.Close();
                }

                message.Status = DiagnosticMessageStatus.OK;
            }
            catch (System.Exception ex)
            {
                message.Status       = DiagnosticMessageStatus.Error;
                message.ErrorMessage = ex.Message;
            }
        }
Example #11
0
        private DiagnosticMessage PingBulkOpService()
        {
            DiagnosticMessage msg = new DiagnosticMessage()
            {
                EntityName  = GetFullyQualifiedName(),
                NetworkName = hostName.ResolvedValue,
                ServiceName = "RemoteService"
            };

            try
            {
                var    c   = RemoteServiceHelper.GetControlObject(hostName.ResolvedValue);
                string res = c.Hello();

                msg.Status = DiagnosticMessageStatus.OK;
            }
            catch (System.Exception ex)
            {
                msg.Status       = DiagnosticMessageStatus.Error;
                msg.ErrorMessage = ex.Message;
            }

            return(msg);
        }
Example #12
0
        private DiagnosticMessage Ping()
        {
            DiagnosticMessage msg = new DiagnosticMessage()
            {
                EntityName  = GetFullyQualifiedName(),
                NetworkName = hostName.ResolvedValue,
                ServiceName = "Ping"
            };

            Ping      ping  = new Ping();
            PingReply reply = ping.Send(hostName.ResolvedValue);

            if (reply.Status == IPStatus.Success)
            {
                msg.Status = DiagnosticMessageStatus.OK;
            }
            else
            {
                msg.Status       = DiagnosticMessageStatus.Error;
                msg.ErrorMessage = reply.Status.ToString();
            }

            return(msg);
        }
Example #13
0
        private DiagnosticMessage PingBulkOpService()
        {
            DiagnosticMessage msg = new DiagnosticMessage()
            {
                EntityName = GetFullyQualifiedName(),
                NetworkName = hostName.ResolvedValue,
                ServiceName = "RemoteService"
            };

            try
            {
                var c = RemoteServiceHelper.GetControlObject(hostName.ResolvedValue);
                string res = c.Hello();

                msg.Status = DiagnosticMessageStatus.OK;
            }
            catch (System.Exception ex)
            {
                msg.Status = DiagnosticMessageStatus.Error;
                msg.ErrorMessage = ex.Message;
            }

            return msg;
        }
Example #14
0
        private DiagnosticMessage Ping()
        {
            DiagnosticMessage msg = new DiagnosticMessage()
            {
                EntityName = GetFullyQualifiedName(),
                NetworkName = hostName.ResolvedValue,
                ServiceName = "Ping"
            };

            Ping ping = new Ping();
            PingReply reply = ping.Send(hostName.ResolvedValue);

            if (reply.Status == IPStatus.Success)
            {
                msg.Status = DiagnosticMessageStatus.OK;
            }
            else
            {
                msg.Status = DiagnosticMessageStatus.Error;
                msg.ErrorMessage = reply.Status.ToString();
            }

            return msg;
        }
 public DiagnosticMessage(DiagnosticMessage old)
 {
     CopyMembers(old);
 }
Example #16
0
 public DiagnosticMessage(DiagnosticMessage old)
 {
     CopyMembers(old);
 }