新增获取磁盘主机的信息
This commit is contained in:
@@ -32,7 +32,6 @@ public final class HostInfo {
|
||||
session = createSession(hostIp, port, username, password);
|
||||
SysHost host = collectHost(session);
|
||||
List<DiskMount> disks = collectDisk(session);
|
||||
disks.forEach(d -> d.setSysHostId(host.getSysHostId()));
|
||||
return new Result(host, disks);
|
||||
} finally {
|
||||
if (session != null && session.isConnected()) {
|
||||
@@ -80,8 +79,6 @@ public final class HostInfo {
|
||||
/* ========== 采集主机信息 ========== */
|
||||
private static SysHost collectHost(Session session) throws Exception {
|
||||
SysHost host = new SysHost();
|
||||
String id = vId.getUid();
|
||||
host.setSysHostId(id);
|
||||
host.setHostTag(HOST_TAG);
|
||||
host.setHostname(exec(session, "hostname -s"));
|
||||
host.setCpuArch(exec(session, "uname -m"));
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.mini.capi.utils;
|
||||
|
||||
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
@@ -30,7 +29,6 @@ public class vDate {
|
||||
return dateTime.format(DateTimeFormatter.ofPattern(pattern));
|
||||
}
|
||||
|
||||
|
||||
public static String getNow() {
|
||||
Date date = new Date();
|
||||
return DEFAULT_SDF.format(date);
|
||||
|
||||
Reference in New Issue
Block a user