Showing
1 changed file
with
13 additions
and
11 deletions
@@ -6,6 +6,7 @@ import com.sitech.ismp.coll.basic.TblATO_KPIDETAIL; | @@ -6,6 +6,7 @@ import com.sitech.ismp.coll.basic.TblATO_KPIDETAIL; | ||
6 | import com.sitech.ismp.coll.middleware.tomcat.impl.ICollTomcat; | 6 | import com.sitech.ismp.coll.middleware.tomcat.impl.ICollTomcat; |
7 | 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; | 8 | import com.sitech.util.Formater; |
9 | +import org.apache.log4j.Logger; | ||
9 | 10 | ||
10 | import java.text.ParseException; | 11 | import java.text.ParseException; |
11 | import java.util.Date; | 12 | import java.util.Date; |
@@ -13,6 +14,7 @@ import java.util.HashMap; | @@ -13,6 +14,7 @@ import java.util.HashMap; | ||
13 | import java.util.Vector; | 14 | import java.util.Vector; |
14 | 15 | ||
15 | public class CollTomcat implements CollTomcatMBean { | 16 | public class CollTomcat implements CollTomcatMBean { |
17 | + private static Logger log= Logger.getLogger(CollTomcat.class); | ||
16 | 18 | ||
17 | public Vector<TblATO_KPIDETAIL> getMemory(HashMap<String, String> params) { | 19 | public Vector<TblATO_KPIDETAIL> getMemory(HashMap<String, String> params) { |
18 | TomcatCollFactory factory = new TomcatCollFactory(); | 20 | TomcatCollFactory factory = new TomcatCollFactory(); |
@@ -68,36 +70,36 @@ public class CollTomcat implements CollTomcatMBean { | @@ -68,36 +70,36 @@ public class CollTomcat implements CollTomcatMBean { | ||
68 | */ | 70 | */ |
69 | @Override | 71 | @Override |
70 | 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 | + */ | ||
76 | + String kbp_class="10-12-13-20"; | ||
77 | + String kpiId="FM-00-12-001-999"; | ||
71 | Vector<TblATO_KPIDETAIL> vector=new Vector<TblATO_KPIDETAIL>(); | 78 | Vector<TblATO_KPIDETAIL> vector=new Vector<TblATO_KPIDETAIL>(); |
72 | String jmx_url=params.get("JMX_URL"); | 79 | String jmx_url=params.get("JMX_URL"); |
73 | int start=jmx_url.indexOf("/rmi://"); | 80 | int start=jmx_url.indexOf("/rmi://"); |
74 | int end=jmx_url.lastIndexOf(":"); | 81 | int end=jmx_url.lastIndexOf(":"); |
75 | String ip=jmx_url.substring(start+7,end); | 82 | String ip=jmx_url.substring(start+7,end); |
83 | + /** | ||
84 | + * domain_name 实际就是 资源标识。 | ||
85 | + */ | ||
76 | String domain_name = params.get("DOMAIN_NAME"); | 86 | String domain_name = params.get("DOMAIN_NAME"); |
77 | - String unitId = "10-12-13-12:" + Formater.neatenunitid(domain_name) + "-MEMORY"; | 87 | + String unitId = kbp_class +":"+ Formater.neatenunitid(domain_name) + "-RUNTIME"; |
78 | CheckConnectionState server=new CheckConnectionState(); | 88 | CheckConnectionState server=new CheckConnectionState(); |
79 | TblATO_KPIDETAIL kpidetail=new TblATO_KPIDETAIL(); | 89 | TblATO_KPIDETAIL kpidetail=new TblATO_KPIDETAIL(); |
80 | try { | 90 | try { |
81 | kpidetail.setUNIT_ID(unitId); | 91 | kpidetail.setUNIT_ID(unitId); |
82 | - kpidetail.setKPI_ID("FM-00-12-001-999"); | 92 | + kpidetail.setKPI_ID(kpiId); |
83 | kpidetail.setKPI_VALUE(server.getPingState(new ParamterBean(ip))); | 93 | kpidetail.setKPI_VALUE(server.getPingState(new ParamterBean(ip))); |
84 | kpidetail.setCLL_TIME(new Date()); | 94 | kpidetail.setCLL_TIME(new Date()); |
85 | vector.add(kpidetail); | 95 | vector.add(kpidetail); |
86 | - } catch (ParseException e) { | 96 | + } catch (ParseException e){ |
87 | e.printStackTrace(); | 97 | e.printStackTrace(); |
88 | } | 98 | } |
89 | return vector; | 99 | return vector; |
90 | } | 100 | } |
91 | 101 | ||
92 | 102 | ||
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 | 103 | ||
102 | @Override | 104 | @Override |
103 | public Vector<TblATO_KPIDETAIL> getThreading(HashMap<String, String> params) { | 105 | public Vector<TblATO_KPIDETAIL> getThreading(HashMap<String, String> params) { |
-
Please register or login to post a comment