1
|
package com.sitech.ismp.coll.middleware.tomcat;
|
1
|
package com.sitech.ismp.coll.middleware.tomcat;
|
2
|
|
2
|
|
3
|
-import java.util.HashMap;
|
|
|
4
|
-import java.util.Vector;
|
|
|
5
|
-
|
3
|
+import com.sitech.ismp.check.downtime.CheckConnectionState;
|
|
|
4
|
+import com.sitech.ismp.check.downtime.ParamterBean;
|
6
|
import com.sitech.ismp.coll.basic.TblATO_KPIDETAIL;
|
5
|
import com.sitech.ismp.coll.basic.TblATO_KPIDETAIL;
|
7
|
import com.sitech.ismp.coll.middleware.tomcat.impl.ICollTomcat;
|
6
|
import com.sitech.ismp.coll.middleware.tomcat.impl.ICollTomcat;
|
8
|
import com.sitech.ismp.coll.middleware.tomcat.impl.TomcatCollFactory;
|
7
|
import com.sitech.ismp.coll.middleware.tomcat.impl.TomcatCollFactory;
|
|
|
8
|
+import com.sitech.util.Formater;
|
|
|
9
|
+
|
|
|
10
|
+import java.text.ParseException;
|
|
|
11
|
+import java.util.Date;
|
|
|
12
|
+import java.util.HashMap;
|
|
|
13
|
+import java.util.Vector;
|
9
|
|
14
|
|
10
|
public class CollTomcat implements CollTomcatMBean {
|
15
|
public class CollTomcat implements CollTomcatMBean {
|
11
|
|
16
|
|
|
@@ -56,6 +61,44 @@ public class CollTomcat implements CollTomcatMBean { |
|
@@ -56,6 +61,44 @@ public class CollTomcat implements CollTomcatMBean { |
56
|
return null;
|
61
|
return null;
|
57
|
}
|
62
|
}
|
58
|
|
63
|
|
|
|
64
|
+ /**
|
|
|
65
|
+ * 获取中间件所在主机的ping状态。
|
|
|
66
|
+ * @param params
|
|
|
67
|
+ * @return
|
|
|
68
|
+ */
|
|
|
69
|
+ @Override
|
|
|
70
|
+ public Vector<TblATO_KPIDETAIL> getPingStatus(HashMap<String, String> params) {
|
|
|
71
|
+ Vector<TblATO_KPIDETAIL> vector=new Vector<TblATO_KPIDETAIL>();
|
|
|
72
|
+ String jmx_url=params.get("JMX_URL");
|
|
|
73
|
+ int start=jmx_url.indexOf("/rmi://");
|
|
|
74
|
+ int end=jmx_url.lastIndexOf(":");
|
|
|
75
|
+ String ip=jmx_url.substring(start+7,end);
|
|
|
76
|
+ String domain_name = params.get("DOMAIN_NAME");
|
|
|
77
|
+ String unitId = "10-12-13-12:" + Formater.neatenunitid(domain_name) + "-MEMORY";
|
|
|
78
|
+ CheckConnectionState server=new CheckConnectionState();
|
|
|
79
|
+ TblATO_KPIDETAIL kpidetail=new TblATO_KPIDETAIL();
|
|
|
80
|
+ try {
|
|
|
81
|
+ kpidetail.setUNIT_ID(unitId);
|
|
|
82
|
+ kpidetail.setKPI_ID("FM-00-12-001-999");
|
|
|
83
|
+ kpidetail.setKPI_VALUE(server.getPingState(new ParamterBean(ip)));
|
|
|
84
|
+ kpidetail.setCLL_TIME(new Date());
|
|
|
85
|
+ vector.add(kpidetail);
|
|
|
86
|
+ } catch (ParseException e) {
|
|
|
87
|
+ e.printStackTrace();
|
|
|
88
|
+ }
|
|
|
89
|
+ return vector;
|
|
|
90
|
+ }
|
|
|
91
|
+
|
|
|
92
|
+
|
|
|
93
|
+ public static void main(String [] args){
|
|
|
94
|
+ String jmx_url="service:jmx:rmi:///jndi/rmi://172.21.1.100:1093/jmxrmi";
|
|
|
95
|
+ int start=jmx_url.indexOf("/rmi://");
|
|
|
96
|
+ int end=jmx_url.lastIndexOf(":");
|
|
|
97
|
+
|
|
|
98
|
+ String ip=jmx_url.substring(start+7,end);
|
|
|
99
|
+ System.out.println(ip);
|
|
|
100
|
+ }
|
|
|
101
|
+
|
59
|
@Override
|
102
|
@Override
|
60
|
public Vector<TblATO_KPIDETAIL> getThreading(HashMap<String, String> params) {
|
103
|
public Vector<TblATO_KPIDETAIL> getThreading(HashMap<String, String> params) {
|
61
|
TomcatCollFactory factory = new TomcatCollFactory();
|
104
|
TomcatCollFactory factory = new TomcatCollFactory();
|