修改getSSH方法,当ping通的情况下才检查连接状态。
Showing
1 changed file
with
2 additions
and
2 deletions
@@ -153,10 +153,10 @@ public class CollLinuxHost implements CollLinuxHostMBean { | @@ -153,10 +153,10 @@ public class CollLinuxHost implements CollLinuxHostMBean { | ||
153 | public Vector getSSH(HashMap params) { | 153 | public Vector getSSH(HashMap params) { |
154 | Vector<TblATO_KPIDETAIL> v=new Vector<TblATO_KPIDETAIL>(); | 154 | Vector<TblATO_KPIDETAIL> v=new Vector<TblATO_KPIDETAIL>(); |
155 | String ip=params.get("IP_ADDR")+""; | 155 | String ip=params.get("IP_ADDR")+""; |
156 | - if(!StringUtils.isEmpty(ip)){ | 156 | + String result=server.getPingResultByIp(ip); |
157 | + if(!StringUtils.isEmpty(result) && "UP".equals(result)){ | ||
157 | String loginStatCode="FM-00-10-001-998"; // linux 主机登录状态 | 158 | String loginStatCode="FM-00-10-001-998"; // linux 主机登录状态 |
158 | ParamterBean bean =new ParamterBean(); | 159 | ParamterBean bean =new ParamterBean(); |
159 | - | ||
160 | String tempPort=params.get("PROTOCOL_PORT")+""; | 160 | String tempPort=params.get("PROTOCOL_PORT")+""; |
161 | int port=0; | 161 | int port=0; |
162 | if(!StringUtils.isEmpty(tempPort)){ | 162 | if(!StringUtils.isEmpty(tempPort)){ |
-
Please register or login to post a comment