public Result MakeChecking() { ErrorMessages.Clear(); var result = new Result() { ResultCode = ResultCode.Ok }; // Ping this._pingMsec = 0; try { using (Ping ping = new Ping()) { this._pingMsec = ping.Send(this.HostName).RoundtripTime; } } catch (Exception ex) { this._pingMsec = (int)ResultCode.CommonError; this.AddErrorMessage(ex, $"Ping of {this.HostName}"); } // Get IP try { this._ip = CommonUtils.GetIPAddressFromMachineName(this.HostName); } catch (Exception ex) { this.AddErrorMessage(ex, $"Getting IP of {this.HostName}"); } // Check Windows Services try { var servicesNames = OptionsHelper.GetWindowsServiceNamesToControl(this.HostName); if (servicesNames.Count != 0) { this.WindowsServicesStatus = ServicesControl.MakeChecking(this.HostName, servicesNames); } } catch (Exception ex) { this.AddErrorMessage(ex, $"Checking Windows Services of {this.HostName}"); } // Check disks status var disksInfo = new List <DiskDataModel>(); try { this.DisksData = DiskUtils.GetDrivesListOfRemoteMachine(this.HostName); } catch (Exception ex) { this.AddErrorMessage(ex, $"Checking disks status of {this.HostName} error"); } // Check Databases status this.IsNesseseryToCheckSqlBases = OptionsHelper.IsNessesaryToCheckDatabase(this.HostName); try { if (this.IsNesseseryToCheckSqlBases) { this.CheckingDatabaseResult = DataBaseUtils.CheckBases(this.HostName); if (!string.IsNullOrEmpty(this.CheckingDatabaseResult.ErrorMessage)) { this.AddErrorMessage(null, this.CheckingDatabaseResult.ErrorMessage); } } } catch (Exception ex) { this.AddErrorMessage(ex, $"Checking databases status of {this.HostName} error"); } return(result); }