private async Task <bool> RunCommandLineRemoteTasks(QlikSenseMachineInfo[] infos) { try { foreach (var info in infos) { var cmds = new CmdLineAgents(_filesystem, _logger); try { var res = await cmds.RunRemoteCmds(info.HostName, TimeSpan.FromMinutes(10)).ConfigureAwait(false); _collectorHelper.WriteContentToFile(res, _filesystem.Path.Combine(ServiceVariables.OutputFolderPath, info.HostName, "SystemInfo.csv")); } catch (Exception e) { _logger.Add($"Failed accessing remote SystemInfo or write on {info?.HostName ?? "UNKNOWN"}", e); } } return(true); } catch (Exception ex) { _logger.Add("Failed running RunCommandLineRemoteTasks", ex); return(false); } }
private async Task <bool> RunCmdLineAgents() { var cmds = new CmdLineAgents(_filesystem, _logger); var res = await cmds.RunLocalCmds().ConfigureAwait(false); _collectorHelper.WriteContentToFile(res, "SystemInfo"); return(true); }