Esempio n. 1
0
 private bool IsMemberOfGroup(string machineName, string memberGroup)
 {
     try
     {
         string userName = WindowsIdentity.GetCurrent().Name;
         using (PrincipalContext domainContext = new PrincipalContext(ContextType.Domain))
             using (UserPrincipal domainUsr = UserPrincipal.FindByIdentity(domainContext, IdentityType.SamAccountName, userName))
             {
                 using (PrincipalContext machineContext = new PrincipalContext(ContextType.Machine, machineName))
                     using (GroupPrincipal grp = GroupPrincipal.FindByIdentity(machineContext, memberGroup))
                         using (UserPrincipal localUsr = UserPrincipal.FindByIdentity(machineContext, IdentityType.SamAccountName, userName))
                         {
                             if (grp != null && domainUsr != null) //local group and domain user
                             {
                                 return(grp.GetMembers(true).Contains(domainUsr));
                             }
                             if (grp != null && localUsr != null) //local group and local user
                             {
                                 return(grp.GetMembers(true).Contains(localUsr));
                             }
                         }
             }
     }
     catch (Exception e)
     {
         _logger.Add("Failed getting Is Member of api group", e);
     }
     return(false);
 }
        public string GetQlikSenseArchivedFolderLocation(SenseApiSupport senseApiSupport)
        {
            dynamic json = senseApiSupport.RequestWithResponse(
                ApiMethod.Get,
                $"https://{senseApiSupport.Host}:4242/qrs/ServiceCluster/{_serviceClusterId}",
                null,
                null,
                HttpStatusCode.OK,
                JToken.Parse);
            string ret;

            try
            {
                ret = json?.settings?.sharedPersistenceProperties?.archivedLogsRootFolder?.Value ?? "";
            }
            catch (Exception ex) //We dont trust the API to not change case.
            {
                _logger.Add($"Failed parsing the ServiceCluster and get the archived folder path moving to case insensitive search {ex}");
                var settings = GetNode(json, "settings");
                var sharedPersistenceProperties = GetNode(settings?.Value, "sharedPersistenceProperties");
                ret = GetNode(sharedPersistenceProperties?.Value, "archivedLogsRootFolder")?.Value ?? "";
            }

            if (string.IsNullOrWhiteSpace(ret))
            {
                _logger.Add($"WARNING-Archived Logs conn string missing.");
                _logger.Add($"ServiceCluster=>{json?.ToString().Replace(Environment.NewLine, @"\r\n")}");
            }
            return(ret);
        }
Esempio n. 3
0
 private void DoInit()
 {
     _anime = new AnimationHelper(this);
     this.MakeLabelTransparent(lblGeneralInfo, picCircles);
     this.MakeLabelTransparent(lblPrivacy, picCircles);
     //MessageBox.Show(@"name is " + name);
     //name = "QlikDiagnostics_kjIZWf4yJIu.zip";
     //name = "QlikDiagnostics_cB1RhvFcpI.zip";
     try
     {
         _runner = new Runner(_logger, this);
         _runner.Settings.CollectorOutput.LogCollectorVersion = Application.ProductVersion;
         _runner.DoneAction = Done;
         chkSysInfo.Checked = true; //_settings.AllowMachineInfo;
         chkWinLogs.Checked = true; //_settings.AllowWindowsLogs;
         chkOnline.Checked  = _runner.Settings.UseOnlineDelivery;
         dteStart.Value     = _runner.Settings.StartDateForLogs;
         dteStop.Value      = _runner.Settings.StopDateForLogs;
         txtCaseNr.Text     = _runner.Settings.Key;
     }
     catch (Exception e)
     {
         _logger.Add("Error in startup", e);
         Notify("Failed getting output folder. Please run with higer user rights.", MessageLevels.Error);
         ResetUiFinished();
     }
 }
Esempio n. 4
0
        private void GetFiles(string dir, DateTime from, DateTime to, string outputFilePath)
        {
            try
            {
                if (!_fileSystem.DirectoryExists(dir))
                {
                    _logger.Add($"The directory {dir} does not exist");
                    return;
                }

                DirectoryInfo info = new DirectoryInfo();
                Trace.WriteLine($"start => {dir}");
                var files = info.EnumerateLogFiles(dir, from, to);
                foreach (IFileInfo file in files)
                {
                    file.Refresh(); //some files are returning empty even though they are not. Shown 0 bytes in explorer until opened in notepad.
                    _fileWriter(file, outputFilePath);
                }

                var configs = info.EnumerateFilesByExtension(dir, new List <string> {
                    ".ini", ".config", ".xml", ".pgo"
                });
                foreach (IFileInfo file in configs)
                {
                    _fileWriter(file, outputFilePath);
                }

                Trace.WriteLine($"stop  => {dir}");
            }
            catch (Exception e)
            {
                _logger.Add($"Failed getting files on path {dir}", e);
            }
        }
 public string Index()
 {
     _logger.Add("test", DateTime.Now);
     _logger.Add("test2", Environment.CurrentDirectory);
     _logger.Add("test3", Environment.OSVersion);
     _logger.Add("test4", null);
     return("Apsiyon.Logger - .NET Core 3.1 MVC Demo");
 }
        public Task ReadArchivedLogs(string archivedLogsLocation, CommonCollectorServiceVariables settings)
        {
            _logger.Add("Reading Archived Logs");
            var a = new StreamLogDirector(_logger, _notify)
            {
                FriendlyName = "Archived Logs", NotificationKey = "ArchivedLogs"
            };

            return(Task.Run(async() =>
            {
                //a.OnLogDirectorFinishedReading(_onFinished);
                if (string.IsNullOrEmpty(archivedLogsLocation))
                {
                    archivedLogsLocation = $@"\\{settings.DnsHostName}\SenseShare\Archived Logs";
                }
                //todo: warning fix this.....
                _logger.Add($"Started reading Archived Logs at {archivedLogsLocation}");
                a.LoadAndRead(new[] { new DirectorySetting(archivedLogsLocation) }, settings);
                TotalNumberOfLogFiles += a.FoundFileCount;
                _logger.Add($"Started reading NPrinting logs locally at c:");
                await new NPrintingCollector(FileSystem.Singleton, _logger).GetLogs(@"c:\", settings, FileSystem.Singleton.Path.Combine(settings.OutputFolderPath, settings.DnsHostName)).ConfigureAwait(false);
                _logger.Add($"Started reading Connectors logs locally at c:");
                await new ConnectorsLogCollector(FileSystem.Singleton, _logger).GetLogs(@"c:\", settings, FileSystem.Singleton.Path.Combine(settings.OutputFolderPath, settings.DnsHostName)).ConfigureAwait(false);
                _logger.Add($"Finished reading archived and local logs");
            }
                            ).ContinueWith(p =>
            {
                _onFinished.Invoke(a);
            }));
        }
Esempio n. 7
0
        public Assembly CompileParticlesBlueprints()
        {
            string code = WholeSyntaxGenerator(config);

            state.syntaxTree = CSharpSyntaxTree.ParseText(code);

            string assemblyName = Path.GetRandomFileName();

            logger.Add("\n\n\t\tCOMPILATION\n\n\tGenerated C# syntax tree:\n" + state.syntaxTree);
            //Console.WriteLine(state.syntaxTree);

            IEnumerable <MetadataReference> references = Directory.GetFiles(Path.GetDirectoryName(typeof(object).Assembly.Location))
                                                         .Where((val) => val.EndsWith(".dll"))
                                                         .Where((val) => val.Contains("System."))
                                                         .Append(typeof(CalcEngine.Program).Assembly.Location)
                                                         .Select((str) => MetadataReference.CreateFromFile(str));

            CSharpCompilation compilation = CSharpCompilation.Create(
                assemblyName,
                syntaxTrees: new[] { state.syntaxTree },
                references: references,
                options: new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));



            using (var ms = new MemoryStream())
            {
                EmitResult result = compilation.Emit(ms);

                if (!result.Success)
                {
                    logger.Add("\n\t***** *** Compilation errors occured:\n");

                    IEnumerable <Diagnostic> failures = result.Diagnostics.Where(diagnostic =>
                                                                                 diagnostic.IsWarningAsError ||
                                                                                 diagnostic.Severity == DiagnosticSeverity.Error);

                    foreach (Diagnostic diagnostic in failures)
                    {
                        //Console.Error.WriteLine("{0}: {1}", diagnostic.Id, diagnostic.GetMessage());
                        state.ErrorList.Add(new Exception(diagnostic.Id + ": " + diagnostic.GetMessage() + " line: " + diagnostic.Location));
                        logger.Add("\t\t" + diagnostic.Id + ": " + diagnostic.GetMessage() + " line: " + diagnostic.Location + "\n");
                    }
                }
                else
                {
                    logger.Add("\n\tCompilation Success\n");

                    ms.Seek(0, SeekOrigin.Begin);
                    return(Assembly.Load(ms.ToArray()));
                }
            }
            return(null);
        }
Esempio n. 8
0
        static void Main(string[] args)
        {
            _logger.Add("App is started.");

            WriteLine("Type a message!");

            string message = ReadLine();

            _logger.Add(message);

            _logger.Add("App is finished.");
        }
        private Task <int> RunProcessAsync(Process process, CmdLineResult cmdLine)
        {
            //Notify("started " + cmdLine.Name);
            var tcs    = new TaskCompletionSource <int>();
            var output = new StringBuilder();
            var error  = new StringBuilder();

            try
            {
                process.Exited += (s, ea) =>
                {
                    cmdLine.Result      = output.ToString();
                    cmdLine.Error       = error.ToString();
                    cmdLine.RunComplete = true;
                    cmdLine.CmdExitCode = process.ExitCode;
                    tcs.SetResult(process.ExitCode);
                };
                process.OutputDataReceived += (s, e) =>
                {
                    if (!string.IsNullOrEmpty(e.Data))
                    {
                        output.AppendLine(e.Data);
                    }
                };
                process.ErrorDataReceived += (s, e) =>
                {
                    if (!string.IsNullOrEmpty(e.Data))
                    {
                        error.AppendLine(e.Data);
                    }
                };

                bool started = process.Start();
                if (!started)
                {
                    //you may allow for the process to be re-used (started = false)
                    //but I'm not sure about the guarantees of the Exited event in such a case
                    _logger.Add($"cmd line cmd failed starting");
                    throw new InvalidOperationException("Could not start process: " + process);
                }

                process.BeginOutputReadLine();
                process.BeginErrorReadLine();

                return(tcs.Task);
            }
            catch (Exception e)
            {
                _logger.Add($"cmd line ex : {e}");
                tcs.SetResult(-1);
                return(tcs.Task);
            }
        }
 private void cmdTry_Click(object sender, EventArgs e)
 {
     TheNewPath = txtPath.Text;
     if (!Directory.Exists(TheNewPath))
     {
         _logger.Add("The supplied archived folder is not accessable");
         MessageBox.Show(@"Please supply an existing and accessible directory", @"The directory does not exist.");
         return;
     }
     _logger.Add($"Retrying run with the folder {TheNewPath}");
     DialogResult = DialogResult.OK;
     Close();
 }
Esempio n. 11
0
 public void RunAction(Func <object> func, string name)
 {
     try
     {
         _logger.Add($"Starting running {name}");
         object res = func();
         WriteContentToFile(res, name);
     }
     catch (Exception e)
     {
         Log.Add($"Failed running {name}", e);
     }
 }
Esempio n. 12
0
 public void SendEmail(bool prsUnavailableErrorLimitReached, bool prsTimeoutErrorLimitReached, bool prsTotalErrorLimitReached)
 {
     try
     {
         MailMessage email = ComposeEmail(prsUnavailableErrorLimitReached, prsTimeoutErrorLimitReached, prsTotalErrorLimitReached);
         _smtpClient.Send(email);
         // Set flag to prevent any more emails being sent until flag is reset
         _configFileHelper.RecordEmailHavingBeenSent();
     }
     catch (Exception ex)
     {
         _log.Add("Error Detected: " + ex.Message + ex.InnerException);
     }
 }
 private async Task <List <string> > GetListOfConnctorsInstalled(string hostName)
 {
     return(await Task.Run(() =>
     {
         string path = $@"\\{hostName}\c$\Program Files\Common Files\Qlik\Custom Data";
         try
         {
             return _filesystem.GetDirectories(path).ToList();
         }
         catch (Exception e)
         {
             _logger.Add($"Failed accessing GetListOfConnctorsInstalled '{path}'", e);
             return new List <string>();
         }
     }).ConfigureAwait(false));
 }
Esempio n. 14
0
 private void WriteFile(IFileInfo file, string outputFilePath)
 {
     try
     {
         if (file == null && outputFilePath == null) //hack, there are so ridiculous amount of directories we need to show customers that we are working.
         {
             Interlocked.Add(ref _localDirCounter, +1);
             return;
         }
         //Trace.WriteLine($"{outputFilePath} => {file?.Name}");
         Interlocked.Add(ref _localFileCounter, 1);
         _fileSystem.EnsureDirectory(outputFilePath);
         string outputFileFullPath = _fileSystem.Path.Combine(outputFilePath, file?.Name);
         if (_fileSystem.FileExists(outputFileFullPath))
         {
             outputFileFullPath += "_" + _fileSystem.Path.GetFileNameWithoutExtension(_fileSystem.Path.GetTempFileName());
         }
         _fileSystem.FileCopy(file?.FullName, outputFileFullPath);
         FoundFileCount++;
     }
     catch (Exception ex)
     {
         _logger.Add("Failed writing file->ignored", ex);
     }
 }
        private void WriteFile(IFileInfo file, string outputFilePath)
        {
            if (file == null && outputFilePath == null) //hack, there are so ridiculous amount of directories we need to show customers that we are working.
            {
                Interlocked.Add(ref _localDirCounter, +1);
                return;
            }
            //Trace.WriteLine($"{outputFilePath} => {file?.Name}");
            Interlocked.Add(ref _localFileCounter, 1);

            Trace.WriteLine($"{outputFilePath} => {file?.Name ?? "<Undefined>"}");
            if (file == null)
            {
                _logger.Add("StreamLogDirector. File is null, this is major error in writing file");
                return;
            }

            _fileSystem.EnsureDirectory(outputFilePath);
            string outputFileFullPath = _fileSystem.Path.Combine(outputFilePath, file.Name);

            if (_fileSystem.FileExists(outputFileFullPath))
            {
                outputFileFullPath += "_" + _fileSystem.Path.GetFileNameWithoutExtension(_fileSystem.Path.GetTempFileName());
            }
            _fileSystem.FileCopy(file.FullName, outputFileFullPath);
            FoundFileCount++;
        }
Esempio n. 16
0
        static void LogExecution(ILogger logger, Tuple <Schedule, ScheduleExecutionException> t)
        {
            var schedule = t.Item1;
            var adverb   = t.Item2 == null ? "successfully" : "exceptionally";

            logger.Add($"Executed schedule '{schedule.Name}' {adverb}.");
        }
        private string GetFlatWmiQuery(string query)
        {
            try
            {
                var s = "";
                using (var searcher = new ManagementObjectSearcher("root\\CIMV2", query))
                {
                    foreach (var o in searcher.Get())
                    {
                        //var item = new WindowsServicesInfo();
                        var mobj = (ManagementObject)o;

                        foreach (PropertyData prop in mobj.Properties)
                        {
                            s += $",\r\n{JsonConvert.ToString(prop.Name)} = {JsonConvert.ToString(prop.Value)}";
                        }
                    }
                }

                if (string.IsNullOrWhiteSpace(s) || s.Length < 3)
                {
                    return("");
                }
                s = $"{{{s.Substring(1)}\r\n}}";
                return(s);
            }
            catch (Exception e)
            {
                _logger.Add($"Failed running wmi query => {query}", e);
                return("{}");
            }
        }
Esempio n. 18
0
        public void Do()
        {
            var workFolder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Files");

            var files = _folderProvider.GetUnprocessed(workFolder);

            foreach (var f in files)
            {
                _logger.Add($"Processing file '{f}'");
                var fileContent = _fileReader.Read(f);
                var results     = _matrixProcessor.Process(fileContent);

                var r = _folderProvider.GetResultFileName(f);
                _fileReader.Write(r, results);
                _logger.Add($"File '{f}' processed, results at: '{r}");
            }
        }
Esempio n. 19
0
        bool checkSyntax()
        {
            bool result = true;
            int  pc     = 0;

            _cleanCode.Clear();
            foreach (var textLine in _code.SourceCode)
            {
                ++pc;
                var l = textLine.Trim().Replace("\t", " ");
                if (string.IsNullOrEmpty(textLine))
                {
                    continue;
                }

                var m = Regex.Match(textLine, _codeLinePattern);

                if (!m.Success)
                {
                    _logger.Add($"Check syntax in {pc} line : {textLine}");
                    result = false;
                    continue;
                }

                var codeLine = new CodeLine()
                {
                    LineLabel = m.Groups["Label"].Value ?? "",
                    Command   = m.Groups["code"].Value,
                    Number    = m.Groups["number"].Value
                };

                if (codeLine.Number.StartsWith("#"))
                {
                    if (!Regex.IsMatch(codeLine.Command, "BRA|BRZ|BRP"))
                    {
                        _logger.Add($"Check syntax in {pc} line : {textLine}");
                        result = false;
                        continue;
                    }
                }

                _cleanCode.Add(codeLine);
            }

            return(result);
        }
Esempio n. 20
0
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILogger logger)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            logger.Add("App is configuring.");

            app.Run(async(context) =>
            {
                logger.Add("App is requested.", new { Url = context.Request.GetDisplayUrl() });

                await context.Response.WriteAsync("Hello World!");
            });

            logger.Add("App is configured.");
        }
Esempio n. 21
0
 private static void AddInnerExceptionToLog(Exception ex, ILogger logger)
 {
     if (ex.InnerException != null)
     {
         logger.Add("Произошла ошибка.\r\n" +
                    ex.InnerException.Message + "\r\n" + ex.InnerException.StackTrace);
         AddInnerExceptionToLog(ex.InnerException, logger);
     }
 }
Esempio n. 22
0
        public void ReadEvents(DateTime fromTimestamp, DateTime toTimestamp, Common.CollectorHelper collectorHelper)
        {
            string[] eventNames = "Application,System,Security".Split(',');
            //string[] sourceFilters = "QlikSense...."
            string[] levelFilters = new string[0];// "Warning,Error".Split(',');//
            var      newFrom      = fromTimestamp.AddDays(-2);
            var      name         = collectorHelper.CreateUniqueFileName("WindowsEventLogs");
            bool     firstLine    = true;

            using (System.IO.StreamWriter file = new System.IO.StreamWriter(name))
            {
                file.WriteLine("[");
                foreach (string eventName in eventNames)
                {
                    using (var eventlog = new EventLog(eventName))
                    {
                        foreach (EventLogEntry item in eventlog.Entries)
                        {
                            if ((item.TimeGenerated >= newFrom) &&
                                (item.TimeGenerated < toTimestamp) &&
                                ((levelFilters.Length == 0) || levelFilters.Any(t => t.Equals(item.EntryType.ToString(), StringComparison.OrdinalIgnoreCase))))
                            {
                                try
                                {
                                    var a = new EventLogEntryShort
                                    {
                                        InstanceId = item.InstanceId,
                                        Level      = item.EntryType.ToString(),
                                        Logged     = item.TimeGenerated,
                                        Source     = item.Source,
                                        Message    = item.Message,
                                        LogName    = eventName,
                                        User       = item.UserName
                                    };
                                    file.WriteLine((firstLine ? "": ",") + JsonConvert.SerializeObject(a));  //todo: this is just a temp hack to adust to the fact we have out of memory errors in the old version bfr - 2018-12-19.
                                }
                                catch (Exception ex)
                                {
                                    _errCount++;
                                    Trace.WriteLine(ex);
                                }
                                firstLine = false;
                            }
                        }
                    }
                    if (_errCount > 0)
                    {
                        _logger.Add($"Windows Event log {eventName} failed reading {_errCount} events");
                        _errCount = 0;
                    }
                }
                file.WriteLine("]");
            }
        }
Esempio n. 23
0
        public FrmResult(QlikViewCollectorService service, ILogger logger)
        {
            InitializeComponent();
            try
            {
                var loc = service?.ServiceVariables?.CollectorOutput?.ZipFile;
                if (string.IsNullOrEmpty(loc))
                {
                    MessageBox.Show(@"We have no files to show. You probably don't have the right access rights.", @"Failure getting output path");
                    logger.Add("No files to show in FrmResults. Probably access rights.");
                }

                txtLogFile.Text = loc;
            }
            catch (Exception ex)
            {
                logger.Add("Failure to show files to show in FrmResults. Probably access rights.", ex);
                MessageBox.Show(@"We have no files to show. Something went badly wrong", @"Failure getting output path");
            }
        }
Esempio n. 24
0
        private void Run(object state)
        {
            try
            {
                _logger.Add($"{Name}; ThreadId={Thread.CurrentThread.ManagedThreadId} начал работу");
                var stopWatch = new Stopwatch();
                stopWatch.Start();

                Execute(_part);

                stopWatch.Stop();
                _logger.Add(
                    $"{Name}; ThreadId={Thread.CurrentThread.ManagedThreadId} закончил заботу с part {_part} за {stopWatch.ElapsedMilliseconds} ms");
                _statistic.Add(Name, stopWatch.ElapsedMilliseconds, _systemInfoProvider.PagedMemorySize64);
                _nextQueue?.Add(_part);
            }
            catch (Exception ex)
            {
                _exceptionHandler(ex);
            }
        }
Esempio n. 25
0
        private void AddLog(int?userid, string TableName, string Extention, int id)
        {
            EsateLoging objLog = new EsateLoging();

            objLog.LogDate     = DateTime.Now;
            objLog.LogExeption = Extention;
            objLog.LogTable    = TableName;
            objLog.LogTableId  = id;
            objLog.Userid      = userid;

            _logger.Add(objLog);
        }
Esempio n. 26
0
 private void OnAppDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
 {
     try
     {
         faultLogger.Add("AppDispatcherUnhandledException : {0}\r\n {1}", e.Exception.Message, e.Exception.StackTrace);
         e.Handled = true;
     }
     catch (Exception ex)
     {
         throw new InvalidOperationException("FATAL ERRROR : " + ex.Message, ex);
     }
 }
        private void ShowRunHowTo()
        {
            var dlg = new FrmConnectionIssuesInfo(ConnectDto);

            dlg.ShowDialogueCenterParent(this);
            _logger.Add($"Conn issue form is showing the info form");
        }
Esempio n. 28
0
        private ApplMode?GetMode(string[] args)
        {
            if (args == null)
            {
                return(null);
            }

            if (args.Length < 1)
            {
                _logger.Add("Не задан режим работы compress/decompress");
                return(null);
            }
            var argModeValue = args[0];

            switch (argModeValue)
            {
            case "compress":
                return(ApplMode.Compress);

            case "decompress":
                return(ApplMode.Decompress);
            }
            _logger.Add("Не задан режим работы compress/decompress");
            return(null);
        }
Esempio n. 29
0
        public void SetCurrentFolderNames(string machineName, string currentLogFolder)
        {
            try
            {
                lock (_lock)
                {
                    if (machineName != null)
                    {
                        _msg = $"Collecting Logs from {machineName}";
                    }
                    if (currentLogFolder != null)
                    {
                        _currentLogFolder = currentLogFolder;
                    }
                }

                _notify(_msg, MessageLevels.Animate, _notificationKey);
            }
            catch (Exception e)
            {
                _logger.Add("Failed in Folder Notification helper SetCurrentFolderNames", e);
            }
        }
Esempio n. 30
0
 public SenseConnectDto TryAccessSenseApi(SenseConnectDto dto)
 {
     try
     {
         _logger.Add($"Trying connecting to Sense Server on {dto.SenseHostName}.");
         dto.SenseApiSupport = SenseApiSupport.Create(dto.SenseHostName);
         dto.SenseServerLocationFinderStatus = SenseServerLocationFinderStatus.Success;
         return(dto);
     }
     catch (Exception ex)
     {
         if (ex is AggregateException agrEx)
         {
             dto.SenseServerLocationFinderStatus = SenseServerLocationFinderStatus.NotAccessable;
             foreach (var item in agrEx.InnerExceptions)
             {
                 if (item.Message.Contains("403"))
                 {
                     dto.SenseServerLocationFinderStatus = SenseServerLocationFinderStatus.Forbidden;
                 }
             }
         }
         else
         {
             dto.SenseServerLocationFinderStatus =
                 ex.Message.Contains("No valid Qlik Sense client certificate found.")
                     ? SenseServerLocationFinderStatus.NoSertificateFound
                     : SenseServerLocationFinderStatus.NotAccessable;
         }
         _logger.Add($"TryAccessSenseApi failed locating api on machine {dto.SenseHostName} with status {dto.SenseServerLocationFinderStatus} and exception {ex}");
         if (dto.SenseServerLocationFinderStatus == SenseServerLocationFinderStatus.Undefined)
         {
             dto.SenseServerLocationFinderStatus = SenseServerLocationFinderStatus.UnknownFailure;
         }
         return(dto);
     }
 }