🔨 修改配置.
This commit is contained in:
@@ -83,6 +83,9 @@ public class HostAgentApiImpl implements HostAgentApi {
|
||||
.filter(Strings::isNotBlank)
|
||||
.map(Long::parseLong)
|
||||
.collect(Collectors.toList());
|
||||
if (logIdList.isEmpty()) {
|
||||
return Lists.empty();
|
||||
}
|
||||
// 查询数据库
|
||||
return hostAgentLogDAO.selectBatchIds(logIdList)
|
||||
.stream()
|
||||
|
||||
@@ -72,12 +72,21 @@ public class HostVO implements Serializable {
|
||||
@Schema(description = "主机地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "主机端口")
|
||||
private Integer port;
|
||||
|
||||
@Schema(description = "主机状态")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "agentKey")
|
||||
private String agentKey;
|
||||
|
||||
@Schema(description = "探针版本")
|
||||
private String agentVersion;
|
||||
|
||||
@Schema(description = "探针安装状态")
|
||||
private Integer agentInstallStatus;
|
||||
|
||||
@Schema(description = "探针在线状态")
|
||||
private Integer agentOnlineStatus;
|
||||
|
||||
@Schema(description = "描述")
|
||||
private String description;
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ public abstract class AbstractAgentInstaller implements AgentInstaller {
|
||||
this.params = params;
|
||||
this.logId = params.getLogId();
|
||||
this.startScriptName = Const.START + HostOsTypeEnum.of(params.getOsType()).getScriptSuffix();
|
||||
this.uploadAgentName = FileConst.INSTANT_AGENT_NAME + HostOsTypeEnum.of(params.getOsType()).getBinarySuffix();
|
||||
this.uploadAgentName = FileConst.INSTANCE_AGENT_NAME + HostOsTypeEnum.of(params.getOsType()).getBinarySuffix();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -154,7 +154,7 @@ public abstract class AbstractAgentInstaller implements AgentInstaller {
|
||||
protected String getAgentHomePath() {
|
||||
return PathUtils.buildAppPath(HostOsTypeEnum.WINDOWS.name().equals(params.getOsType()),
|
||||
sshConfig.getUsername(),
|
||||
FileConst.INSTANT_AGENT_PATH) + Const.SLASH;
|
||||
FileConst.INSTANCE_AGENT_PATH) + Const.SLASH;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -75,8 +75,6 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
public class HostAgentServiceImpl implements HostAgentService {
|
||||
|
||||
private static final String AGENT_FILE_FORMAT = "agent_{}_{}{}";
|
||||
|
||||
private String localVersion;
|
||||
|
||||
@Value("${orion.api.expose.token}")
|
||||
@@ -95,7 +93,7 @@ public class HostAgentServiceImpl implements HostAgentService {
|
||||
public void readLocalAgentVersion() {
|
||||
log.info("HostAgentService-readLocalAgentVersion start");
|
||||
// 文件路径
|
||||
String path = PathUtils.getOrionPath(FileConst.INSTANT_AGENT_RELEASE + Const.SLASH + FileConst.VERSION);
|
||||
String path = PathUtils.getOrionPath(FileConst.INSTANCE_AGENT_RELEASE + Const.SLASH + FileConst.VERSION);
|
||||
log.info("HostAgentService-readLocalAgentVersion path: {}", path);
|
||||
try {
|
||||
if (!Files1.isFile(path)) {
|
||||
@@ -191,9 +189,9 @@ public class HostAgentServiceImpl implements HostAgentService {
|
||||
Valid.notBlank(fileName, ErrorMessage.FILE_EXTENSION_TYPE);
|
||||
Valid.isTrue(fileName.endsWith(Const.SUFFIX_TAR_GZ), ErrorMessage.FILE_EXTENSION_TYPE);
|
||||
// 保存文件
|
||||
String releaseDir = PathUtils.getOrionPath(FileConst.INSTANT_AGENT_RELEASE);
|
||||
String releaseTempDir = PathUtils.getOrionPath(FileConst.INSTANT_AGENT_RELEASE_TEMP);
|
||||
File releaseTempFile = new File(releaseTempDir + Const.SLASH + FileConst.INSTANT_AGENT_RELEASE_TAR_GZ);
|
||||
String releaseDir = PathUtils.getOrionPath(FileConst.INSTANCE_AGENT_RELEASE);
|
||||
String releaseTempDir = PathUtils.getOrionPath(FileConst.INSTANCE_AGENT_RELEASE_TEMP);
|
||||
File releaseTempFile = new File(releaseTempDir + Const.SLASH + FileConst.INSTANCE_AGENT_RELEASE_TAR_GZ);
|
||||
log.info("HostAgentService.installAgent start releaseTempDir: {}, releaseTempFile: {}", releaseTempDir, releaseTempFile.getAbsolutePath());
|
||||
try {
|
||||
// 创建目录
|
||||
@@ -269,7 +267,7 @@ public class HostAgentServiceImpl implements HostAgentService {
|
||||
Valid.isTrue(supportSsh, ErrorMessage.PLEASE_CHECK_HOST_SSH, host.getName());
|
||||
// 文件名称
|
||||
HostOsTypeEnum os = HostOsTypeEnum.of(host.getOsType());
|
||||
String agentFileName = Strings.format(AGENT_FILE_FORMAT,
|
||||
String agentFileName = Strings.format(FileConst.INSTANCE_AGENT_FILE_FORMAT,
|
||||
os.name().toLowerCase(),
|
||||
host.getArchType().toLowerCase(),
|
||||
os.getBinarySuffix());
|
||||
@@ -278,9 +276,9 @@ public class HostAgentServiceImpl implements HostAgentService {
|
||||
.hostId(host.getId())
|
||||
.osType(host.getOsType())
|
||||
.agentKey(host.getAgentKey())
|
||||
.agentFilePath(PathUtils.getOrionPath(FileConst.INSTANT_AGENT_RELEASE + Const.SLASH + agentFileName))
|
||||
.configFilePath(PathUtils.getOrionPath(FileConst.INSTANT_AGENT_RELEASE + Const.SLASH + FileConst.CONFIG_YAML))
|
||||
.startScriptPath(PathUtils.getOrionPath(FileConst.INSTANT_AGENT_RELEASE + Const.SLASH + Const.START + os.getScriptSuffix()))
|
||||
.agentFilePath(PathUtils.getOrionPath(FileConst.INSTANCE_AGENT_RELEASE + Const.SLASH + agentFileName))
|
||||
.configFilePath(PathUtils.getOrionPath(FileConst.INSTANCE_AGENT_RELEASE + Const.SLASH + FileConst.CONFIG_YAML))
|
||||
.startScriptPath(PathUtils.getOrionPath(FileConst.INSTANCE_AGENT_RELEASE + Const.SLASH + Const.START + os.getScriptSuffix()))
|
||||
.build();
|
||||
taskParams.add(params);
|
||||
// 添加待检查文件
|
||||
|
||||
Reference in New Issue
Block a user