diff --git a/application/src/main/java/org/thingsboard/server/service/edge/instructions/DefaultEdgeInstallService.java b/application/src/main/java/org/thingsboard/server/service/edge/instructions/DefaultEdgeInstallService.java index 9dd65eef60..2c4a14635d 100644 --- a/application/src/main/java/org/thingsboard/server/service/edge/instructions/DefaultEdgeInstallService.java +++ b/application/src/main/java/org/thingsboard/server/service/edge/instructions/DefaultEdgeInstallService.java @@ -67,7 +67,9 @@ public class DefaultEdgeInstallService implements EdgeInstallService { dockerInstallInstructions = dockerInstallInstructions.replace("${LOCALHOST_WARNING}", ""); dockerInstallInstructions = dockerInstallInstructions.replace("${BASE_URL}", baseUrl); } - dockerInstallInstructions = dockerInstallInstructions.replace("${TB_EDGE_VERSION}", appVersion + "EDGE"); + String edgeVersion = appVersion + "EDGE"; + edgeVersion = edgeVersion.replace("-SNAPSHOT", ""); + dockerInstallInstructions = dockerInstallInstructions.replace("${TB_EDGE_VERSION}", edgeVersion); dockerInstallInstructions = dockerInstallInstructions.replace("${CLOUD_ROUTING_KEY}", edge.getRoutingKey()); dockerInstallInstructions = dockerInstallInstructions.replace("${CLOUD_ROUTING_SECRET}", edge.getSecret()); dockerInstallInstructions = dockerInstallInstructions.replace("${CLOUD_RPC_PORT}", Integer.toString(rpcPort)); diff --git a/common/util/pom.xml b/common/util/pom.xml index 58e5063390..c81d6ae8bc 100644 --- a/common/util/pom.xml +++ b/common/util/pom.xml @@ -89,7 +89,7 @@ data - com.github.dblock + com.github.oshi oshi-core diff --git a/common/util/src/main/java/org/thingsboard/common/util/SystemUtil.java b/common/util/src/main/java/org/thingsboard/common/util/SystemUtil.java index 23fb2a6257..927f7f3013 100644 --- a/common/util/src/main/java/org/thingsboard/common/util/SystemUtil.java +++ b/common/util/src/main/java/org/thingsboard/common/util/SystemUtil.java @@ -42,7 +42,7 @@ public class SystemUtil { long total = memory.getTotal(); long available = memory.getAvailable(); return Optional.of(toPercent(total - available, total)); - } catch (Exception e) { + } catch (Throwable e) { log.debug("Failed to get memory usage!!!", e); } return Optional.empty(); @@ -51,7 +51,7 @@ public class SystemUtil { public static Optional getTotalMemory() { try { return Optional.of(HARDWARE.getMemory().getTotal()); - } catch (Exception e) { + } catch (Throwable e) { log.debug("Failed to get total memory!!!", e); } return Optional.empty(); @@ -59,8 +59,8 @@ public class SystemUtil { public static Optional getCpuUsage() { try { - return Optional.of((int) (HARDWARE.getProcessor().getSystemCpuLoad() * 100.0)); - } catch (Exception e) { + return Optional.of((int) (HARDWARE.getProcessor().getSystemCpuLoad(1000) * 100.0)); + } catch (Throwable e) { log.debug("Failed to get cpu usage!!!", e); } return Optional.empty(); @@ -69,7 +69,7 @@ public class SystemUtil { public static Optional getCpuCount() { try { return Optional.of(HARDWARE.getProcessor().getLogicalProcessorCount()); - } catch (Exception e) { + } catch (Throwable e) { log.debug("Failed to get total cpu count!!!", e); } return Optional.empty(); @@ -81,7 +81,7 @@ public class SystemUtil { long total = store.getTotalSpace(); long available = store.getUsableSpace(); return Optional.of(toPercent(total - available, total)); - } catch (Exception e) { + } catch (Throwable e) { log.debug("Failed to get free disc space!!!", e); } return Optional.empty(); @@ -91,7 +91,7 @@ public class SystemUtil { try { FileStore store = Files.getFileStore(Paths.get("/")); return Optional.of(store.getTotalSpace()); - } catch (Exception e) { + } catch (Throwable e) { log.debug("Failed to get total disc space!!!", e); } return Optional.empty(); diff --git a/pom.xml b/pom.xml index 98ade6d54c..8a787e2849 100755 --- a/pom.xml +++ b/pom.xml @@ -150,7 +150,7 @@ 2.21.0 2.12.0 1.12.1 - 3.4.0 + 6.4.2 @@ -2003,7 +2003,7 @@ ${exp4j.version} - com.github.dblock + com.github.oshi oshi-core ${oshi.version}