public bool Execute(ProcessControl processControl)
        {
            if (SqlRepo.AdminScriptsInstalled() == false)
            {
                LogWarning("Installation of Performance Dashboard is incomplete. Please install the latest scripts from PDB's custom pages.");
                return(true);
            }

            bool bSuccess = true;

            base.ExecuteForServers(server =>
            {
                try
                {
                    if (server.ServerTypeId == (int)ServerType.Database)
                    {
                        SqlRepo.EnvironmentCheckRepository.ExecuteCollectDatabaseDetails(server.ServerName);
                    }

                    var serverDetails = GetServerDetails(server);
                    SqlRepo.EnvironmentCheckRepository.SaveServerDetails(serverDetails);
                }
                catch (COMException exception)
                {
                    // Catch RPC exception and swallow for now, but log error to investigate and continue attempting to get details from other servers.
                    bSuccess = false;
                    LogError($"Caught exception ({exception.Message}) for server {server.ServerName}.  Skipping and continuing environment check for other servers.");
                }
            });
            return(bSuccess);
        }
 public bool Execute(ProcessControl processControl)
 {
     if (SqlRepo.AdminScriptsInstalled() == false)
     {
         LogWarning("Installation of Performance Dashboard is incomplete. Please install the latest scripts from PDB's custom pages.");
         return(true);
     }
     SqlRepo.SummarizeSqlServerPageouts();
     return(true);
 }
 public bool Execute(ProcessControl processControl)
 {
     if (SqlRepo.AdminScriptsInstalled() == false)
     {
         LogWarning("Installation of Performance Dashboard is incomplete. Please install the latest scripts from PDB's custom pages.");
         return(true);
     }
     SqlRepo.EnvironmentCheckRepository.ExecuteTuningForkRelativity();
     return(true);
 }
 public bool Execute(ProcessControl processControl)
 {
     if (SqlRepo.AdminScriptsInstalled() == false)
     {
         LogWarning("Installation of Performance Dashboard is incomplete. Please install the latest scripts from PDB's custom pages.");
         return(true);
     }
     SqlRepo.ExecuteVirtualLogFileMonitor(AgentId);
     return(true);
 }
Beispiel #5
0
        public bool Execute(ProcessControl processControl)
        {
            if (SqlRepo.AdminScriptsInstalled() == false)
            {
                LogWarning("Installation of Performance Dashboard is incomplete. Please install the latest scripts from PDB's custom pages.");
                return(true);
            }

            var  checkIFIEnabledValue = SqlRepo.ConfigurationRepository.ReadConfigurationValue(ConfigurationKeys.Section, ConfigurationKeys.EnableInstantFileInitializationCheck);
            bool checkIFIEnabled;

            Boolean.TryParse(checkIFIEnabledValue, out checkIFIEnabled);

            Exception firstFailureException = null;
            Server    firstFailureServer    = null;

            ExecuteForServers(server =>
            {
                if (server.ServerTypeId == (int)ServerType.Database)
                {
                    try
                    {
                        ExecuteTuningForkForServer(server, checkIFIEnabled);
                    }
                    catch (Exception ex)
                    {
                        firstFailureServer    = firstFailureServer ?? server;
                        firstFailureException = firstFailureException ?? ex;
                    }
                }
            });

            if (firstFailureException != null)
            {
                var message = firstFailureException.GetExceptionDetails();
                LogError("Failure Running tunning for {0}. Details: {1}", firstFailureServer.ServerName, message);
                processControl.LastErrorMessage = firstFailureException.ToString();
                return(false);
            }

            return(true);
        }
        public bool Execute(ProcessControl processControl)
        {
            if (SqlRepo.AdminScriptsInstalled() == false)
            {
                LogWarning("Installation of Performance Dashboard is incomplete. Please install the latest scripts from PDB's custom pages.");
                return(true);
            }

            var processCtrl            = this.SqlRepo.ProcessControlRepository.ReadById(ProcessControlId.CycleErrorLog);
            var updateLastExecutedTime = false;

            if (processCtrl == null)
            {
                return(true);
            }

            var execSucceeded = processCtrl.LastExecSucceeded;
            var utcDate       = DateTime.UtcNow;

            try
            {
                this.Log("Called");

                var interval = processCtrl.Frequency.GetValueOrDefault(10080);

                if (interval > 0 && processCtrl.LastProcessExecDateTime.AddMinutes(interval) <= utcDate)
                {
                    updateLastExecutedTime = true;

                    // QoS_CycleErrorLog needs to be run on every active SQL server associated with Relativity
                    var servers = this.SqlRepo.GetRegisteredSQLServers();

                    foreach (var server in servers)
                    {
                        // Run the procedure
                        SqlRepo.CycleSqlErrorLog(server.Name);
                    }

                    execSucceeded = true;
                }
                else
                {
                    this.Log("Called - Skipping due to Interval");
                }
            }
            catch (Exception ex)
            {
                var message = ex.GetExceptionDetails();
                this.LogError("Called - Failure. Details: {0}", message);
                execSucceeded = false;
                processCtrl.LastErrorMessage = ex.ToString();
            }
            finally
            {
                if (updateLastExecutedTime)
                {
                    processCtrl.LastProcessExecDateTime = utcDate;
                }

                processCtrl.LastExecSucceeded = execSucceeded;
                this.SqlRepo.ProcessControlRepository.Update(processControl);
            }

            return(true);
        }