Authored by 王凤

合并分支 'master_zmm' 到 'master'

修改getping方法,添加isPing参数。

修改getping方法,添加isPing参数。

查看合并请求 !9
@@ -253,6 +253,9 @@ public class CollMySQLBySql { @@ -253,6 +253,9 @@ public class CollMySQLBySql {
253 * @return 253 * @return
254 */ 254 */
255 public Vector<TblATO_KPIDETAIL> getPingStatus(HashMap<String,String> params) { 255 public Vector<TblATO_KPIDETAIL> getPingStatus(HashMap<String,String> params) {
  256 + String isPing = params.get("isPing"); // frank 2017-05-19 添加。Y进行ping操作,N不执行
  257 + Vector<TblATO_KPIDETAIL> vector=new Vector<TblATO_KPIDETAIL>();
  258 + if("Y".equals(isPing)){
256 String url = params.get("DB_URL"); 259 String url = params.get("DB_URL");
257 String deviceId = params.get("DEVICE_ID"); 260 String deviceId = params.get("DEVICE_ID");
258 log.info(" ***//////url="+url+"///////////// deviceId="+deviceId+"//////////////////"); 261 log.info(" ***//////url="+url+"///////////// deviceId="+deviceId+"//////////////////");
@@ -260,9 +263,7 @@ public class CollMySQLBySql { @@ -260,9 +263,7 @@ public class CollMySQLBySql {
260 int end=url.lastIndexOf(":"); 263 int end=url.lastIndexOf(":");
261 String ipAddr=url.substring(start+2,end); 264 String ipAddr=url.substring(start+2,end);
262 log.info(" ***/////////////////// ipAddr="+ipAddr+"//////////////////"); 265 log.info(" ***/////////////////// ipAddr="+ipAddr+"//////////////////");
263 -  
264 String kpiId="FM-00-10-001-999"; // mysql 主机连接状态 266 String kpiId="FM-00-10-001-999"; // mysql 主机连接状态
265 -  
266 CheckConnectionState server=new CheckConnectionState(); 267 CheckConnectionState server=new CheckConnectionState();
267 String unitId = KBP_CLASS + "-10" + ":" + deviceId + "-SYS"; 268 String unitId = KBP_CLASS + "-10" + ":" + deviceId + "-SYS";
268 ParamterBean bean=new ParamterBean(); 269 ParamterBean bean=new ParamterBean();
@@ -280,8 +281,8 @@ public class CollMySQLBySql { @@ -280,8 +281,8 @@ public class CollMySQLBySql {
280 log.error(" ****** kpidetail.setUNIT_ID(unitId) has error!"); 281 log.error(" ****** kpidetail.setUNIT_ID(unitId) has error!");
281 e.printStackTrace(); 282 e.printStackTrace();
282 } 283 }
283 - Vector<TblATO_KPIDETAIL> vector=new Vector<TblATO_KPIDETAIL>();  
284 vector.add(kpidetail); 284 vector.add(kpidetail);
  285 + }
285 return vector; 286 return vector;
286 } 287 }
287 288
@@ -332,6 +332,9 @@ public class CollOracleBySql { @@ -332,6 +332,9 @@ public class CollOracleBySql {
332 * @return 332 * @return
333 */ 333 */
334 public Vector getPingStatus(HashMap params)throws Exception { 334 public Vector getPingStatus(HashMap params)throws Exception {
  335 + String isPing = params.get("isPing")+""; // frank 2017-05-19 添加。Y进行ping操作,N不执行
  336 + Vector<TblATO_KPIDETAIL> vector=new Vector<TblATO_KPIDETAIL>();
  337 + if("Y".equals(isPing)){
335 getParams(params); 338 getParams(params);
336 CheckConnectionState server=new CheckConnectionState(); 339 CheckConnectionState server=new CheckConnectionState();
337 String KBP_ID = "10-11-30-10:" + this.NEATENSID + "-SYS"; 340 String KBP_ID = "10-11-30-10:" + this.NEATENSID + "-SYS";
@@ -342,7 +345,9 @@ public class CollOracleBySql { @@ -342,7 +345,9 @@ public class CollOracleBySql {
342 String stat=server.getPingState(bean); 345 String stat=server.getPingState(bean);
343 collectiondbbase.addKPI(KBP_ID, "FM-00-11-001-999", stat); 346 collectiondbbase.addKPI(KBP_ID, "FM-00-11-001-999", stat);
344 log.info(" ************************* getPingStatus ****UNIT_ID ="+KBP_ID+"****stat="+stat+"**"); 347 log.info(" ************************* getPingStatus ****UNIT_ID ="+KBP_ID+"****stat="+stat+"**");
345 - return collectiondbbase.getKPISet(); 348 + vector=collectiondbbase.getKPISet();
  349 + }
  350 + return vector;
346 } 351 }
347 352
348 353
@@ -108,6 +108,8 @@ public class CollLinuxHost implements CollLinuxHostMBean { @@ -108,6 +108,8 @@ public class CollLinuxHost implements CollLinuxHostMBean {
108 */ 108 */
109 public Vector getPing(HashMap params) { 109 public Vector getPing(HashMap params) {
110 Vector<TblATO_KPIDETAIL> v=new Vector<TblATO_KPIDETAIL>(); 110 Vector<TblATO_KPIDETAIL> v=new Vector<TblATO_KPIDETAIL>();
  111 + String isPing = params.get("isPing")+""; // frank 2017-05-19 添加。Y进行ping操作,N不执行
  112 + if("Y".equals(isPing)){
111 String ip=params.get("IP_ADDR")+""; 113 String ip=params.get("IP_ADDR")+"";
112 if(!StringUtils.isEmpty(ip)){ 114 if(!StringUtils.isEmpty(ip)){
113 String connectStatCode="FM-00-10-001-999"; // linux 主机连接状态 115 String connectStatCode="FM-00-10-001-999"; // linux 主机连接状态
@@ -139,6 +141,7 @@ public class CollLinuxHost implements CollLinuxHostMBean { @@ -139,6 +141,7 @@ public class CollLinuxHost implements CollLinuxHostMBean {
139 } 141 }
140 v.add(kpidetail); 142 v.add(kpidetail);
141 } 143 }
  144 + }
142 return v; 145 return v;
143 146
144 } 147 }
@@ -153,8 +156,6 @@ public class CollLinuxHost implements CollLinuxHostMBean { @@ -153,8 +156,6 @@ public class CollLinuxHost implements CollLinuxHostMBean {
153 public Vector getSSH(HashMap params) { 156 public Vector getSSH(HashMap params) {
154 Vector<TblATO_KPIDETAIL> v=new Vector<TblATO_KPIDETAIL>(); 157 Vector<TblATO_KPIDETAIL> v=new Vector<TblATO_KPIDETAIL>();
155 String ip=params.get("IP_ADDR")+""; 158 String ip=params.get("IP_ADDR")+"";
156 - String result=server.getPingResultByIp(ip);  
157 - if(!StringUtils.isEmpty(result) && "UP".equals(result)){  
158 String loginStatCode="FM-00-10-001-998"; // linux 主机登录状态 159 String loginStatCode="FM-00-10-001-998"; // linux 主机登录状态
159 ParamterBean bean =new ParamterBean(); 160 ParamterBean bean =new ParamterBean();
160 String tempPort=params.get("PROTOCOL_PORT")+""; 161 String tempPort=params.get("PROTOCOL_PORT")+"";
@@ -188,7 +189,6 @@ public class CollLinuxHost implements CollLinuxHostMBean { @@ -188,7 +189,6 @@ public class CollLinuxHost implements CollLinuxHostMBean {
188 e.printStackTrace(); 189 e.printStackTrace();
189 } 190 }
190 v.add(kpidetail); 191 v.add(kpidetail);
191 - }  
192 return v; 192 return v;
193 } 193 }
194 194
@@ -30,6 +30,8 @@ public class CollWindows implements CollWindowsMBean { @@ -30,6 +30,8 @@ public class CollWindows implements CollWindowsMBean {
30 */ 30 */
31 public Vector<TblATO_KPIDETAIL> getPingState(HashMap<String, String> params){ 31 public Vector<TblATO_KPIDETAIL> getPingState(HashMap<String, String> params){
32 Vector<TblATO_KPIDETAIL> v=new Vector<TblATO_KPIDETAIL>(); 32 Vector<TblATO_KPIDETAIL> v=new Vector<TblATO_KPIDETAIL>();
  33 + String isPing = params.get("isPing")+""; // frank 2017-05-19 添加。Y进行ping操作,N不执行
  34 + if("Y".equals(isPing)){
33 String ip=params.get("IP"); 35 String ip=params.get("IP");
34 if(!StringUtils.isEmpty(ip)){ 36 if(!StringUtils.isEmpty(ip)){
35 String kpiId="FM-00-10-001-999"; // Windows 主机连接状态 37 String kpiId="FM-00-10-001-999"; // Windows 主机连接状态
@@ -60,6 +62,7 @@ public class CollWindows implements CollWindowsMBean { @@ -60,6 +62,7 @@ public class CollWindows implements CollWindowsMBean {
60 } 62 }
61 v.add(kpidetail); 63 v.add(kpidetail);
62 } 64 }
  65 + }
63 return v; 66 return v;
64 } 67 }
65 68
@@ -74,9 +77,6 @@ public class CollWindows implements CollWindowsMBean { @@ -74,9 +77,6 @@ public class CollWindows implements CollWindowsMBean {
74 Vector<TblATO_KPIDETAIL> v=new Vector<TblATO_KPIDETAIL>(); 77 Vector<TblATO_KPIDETAIL> v=new Vector<TblATO_KPIDETAIL>();
75 String ip=params.get("IP"); 78 String ip=params.get("IP");
76 if(!StringUtils.isEmpty(ip)){ 79 if(!StringUtils.isEmpty(ip)){
77 - String result=server.getPingResultByIp(ip);  
78 - log.info("@@@@@###### getSnmpState ping result="+ result +"###$$$$$$$$$$%%%%%%%%%%");  
79 - if(!StringUtils.isEmpty(result) && "UP".equals(result)){  
80 String kpiId="FM-00-10-001-998"; // Windows 设备登录状态 80 String kpiId="FM-00-10-001-998"; // Windows 设备登录状态
81 ParamterBean bean =new ParamterBean(); 81 ParamterBean bean =new ParamterBean();
82 String tempPort=params.get("PORT"); 82 String tempPort=params.get("PORT");
@@ -100,7 +100,6 @@ public class CollWindows implements CollWindowsMBean { @@ -100,7 +100,6 @@ public class CollWindows implements CollWindowsMBean {
100 } 100 }
101 v.add(kpidetail); 101 v.add(kpidetail);
102 } 102 }
103 - }  
104 return v; 103 return v;
105 } 104 }
106 105
@@ -70,12 +70,11 @@ public class CollTomcat implements CollTomcatMBean { @@ -70,12 +70,11 @@ public class CollTomcat implements CollTomcatMBean {
70 */ 70 */
71 @Override 71 @Override
72 public Vector<TblATO_KPIDETAIL> getPingStatus(HashMap<String, String> params) { 72 public Vector<TblATO_KPIDETAIL> getPingStatus(HashMap<String, String> params) {
73 - /**  
74 - * 该 kbp_class kpiId 如果不存在,需要在页面添加。  
75 - */ 73 + String isPing = params.get("isPing")+""; // frank 2017-05-19 添加。Y进行ping操作,N不执行
  74 + Vector<TblATO_KPIDETAIL> vector=new Vector<TblATO_KPIDETAIL>();
  75 + if("Y".equals(isPing)){
76 String kbp_class="10-12-13-20"; 76 String kbp_class="10-12-13-20";
77 String kpiId="FM-00-12-001-999"; 77 String kpiId="FM-00-12-001-999";
78 - Vector<TblATO_KPIDETAIL> vector=new Vector<TblATO_KPIDETAIL>();  
79 String jmx_url=params.get("JMX_URL"); 78 String jmx_url=params.get("JMX_URL");
80 int start=jmx_url.indexOf("/rmi://"); 79 int start=jmx_url.indexOf("/rmi://");
81 int end=jmx_url.lastIndexOf(":"); 80 int end=jmx_url.lastIndexOf(":");
@@ -96,6 +95,7 @@ public class CollTomcat implements CollTomcatMBean { @@ -96,6 +95,7 @@ public class CollTomcat implements CollTomcatMBean {
96 } catch (ParseException e){ 95 } catch (ParseException e){
97 e.printStackTrace(); 96 e.printStackTrace();
98 } 97 }
  98 + }
99 return vector; 99 return vector;
100 } 100 }
101 101
@@ -136,17 +136,12 @@ public class CollWebLogic implements CollWebLogicMBean{ @@ -136,17 +136,12 @@ public class CollWebLogic implements CollWebLogicMBean{
136 136
137 @Override 137 @Override
138 public Vector<TblATO_KPIDETAIL> getPingStatus(HashMap<String, String> params) { 138 public Vector<TblATO_KPIDETAIL> getPingStatus(HashMap<String, String> params) {
139 - /**  
140 - * 该 kbp_class kpiId 如果不存在,需要在页面添加。  
141 - */ 139 + String isPing = params.get("isPing"); // frank 2017-05-19 添加。Y进行ping操作,N不执行
  140 + Vector<TblATO_KPIDETAIL> vector=new Vector<TblATO_KPIDETAIL>();
  141 + if("Y".equals(isPing)){
142 String kbp_class="10-12-11-20"; 142 String kbp_class="10-12-11-20";
143 String kpiId="FM-00-12-001-999"; 143 String kpiId="FM-00-12-001-999";
144 - Vector<TblATO_KPIDETAIL> vector=new Vector<TblATO_KPIDETAIL>();  
145 String serverip=params.get("SERVERIP"); 144 String serverip=params.get("SERVERIP");
146 -  
147 - /**  
148 - * SERVERNAME 实际就是 资源标识。  
149 - */  
150 String servername = params.get("SERVERNAME"); 145 String servername = params.get("SERVERNAME");
151 String unitId = kbp_class +":"+ Formater.neatenunitid(servername) + "-CONFIG"; 146 String unitId = kbp_class +":"+ Formater.neatenunitid(servername) + "-CONFIG";
152 CheckConnectionState server=new CheckConnectionState(); 147 CheckConnectionState server=new CheckConnectionState();
@@ -160,6 +155,7 @@ public class CollWebLogic implements CollWebLogicMBean{ @@ -160,6 +155,7 @@ public class CollWebLogic implements CollWebLogicMBean{
160 } catch (ParseException e){ 155 } catch (ParseException e){
161 e.printStackTrace(); 156 e.printStackTrace();
162 } 157 }
  158 + }
163 return vector; 159 return vector;
164 } 160 }
165 161