|
@@ -6,6 +6,7 @@ import api.common.util.SshUtil;
|
|
|
import api.common.util.StringUtil;
|
|
|
import com.css.simulation.resource.monitor.mappper.SystemServerMapper;
|
|
|
import lombok.Data;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.sshd.client.SshClient;
|
|
|
import org.apache.sshd.client.session.ClientSession;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -18,6 +19,7 @@ import java.util.List;
|
|
|
@Component
|
|
|
@ConfigurationProperties(prefix = "ssh")
|
|
|
@Data
|
|
|
+@Slf4j
|
|
|
public class MyScheduler {
|
|
|
|
|
|
List<Host> hostList;
|
|
@@ -26,9 +28,12 @@ public class MyScheduler {
|
|
|
SystemServerMapper systemServerManager;
|
|
|
|
|
|
|
|
|
- @Scheduled(fixedDelay = 60 * 60 * 1000)
|
|
|
+// @Scheduled(fixedDelay = 60 * 60 * 1000)
|
|
|
+ @Scheduled(fixedDelay = 2 * 1000)
|
|
|
public void server() {
|
|
|
|
|
|
+ log.info("MyScheduler-------server 获取服务器信息!");
|
|
|
+
|
|
|
|
|
|
hostList.forEach(host -> {
|
|
|
|