Authored by 王凤

合并分支 'master_zmm' 到 'master'

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

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

查看合并请求 !9
... ... @@ -253,6 +253,9 @@ public class CollMySQLBySql {
* @return
*/
public Vector<TblATO_KPIDETAIL> getPingStatus(HashMap<String,String> params) {
String isPing = params.get("isPing"); // frank 2017-05-19 添加。Y进行ping操作,N不执行
Vector<TblATO_KPIDETAIL> vector=new Vector<TblATO_KPIDETAIL>();
if("Y".equals(isPing)){
String url = params.get("DB_URL");
String deviceId = params.get("DEVICE_ID");
log.info(" ***//////url="+url+"///////////// deviceId="+deviceId+"//////////////////");
... ... @@ -260,9 +263,7 @@ public class CollMySQLBySql {
int end=url.lastIndexOf(":");
String ipAddr=url.substring(start+2,end);
log.info(" ***/////////////////// ipAddr="+ipAddr+"//////////////////");
String kpiId="FM-00-10-001-999"; // mysql 主机连接状态
CheckConnectionState server=new CheckConnectionState();
String unitId = KBP_CLASS + "-10" + ":" + deviceId + "-SYS";
ParamterBean bean=new ParamterBean();
... ... @@ -280,8 +281,8 @@ public class CollMySQLBySql {
log.error(" ****** kpidetail.setUNIT_ID(unitId) has error!");
e.printStackTrace();
}
Vector<TblATO_KPIDETAIL> vector=new Vector<TblATO_KPIDETAIL>();
vector.add(kpidetail);
}
return vector;
}
... ...
... ... @@ -332,6 +332,9 @@ public class CollOracleBySql {
* @return
*/
public Vector getPingStatus(HashMap params)throws Exception {
String isPing = params.get("isPing")+""; // frank 2017-05-19 添加。Y进行ping操作,N不执行
Vector<TblATO_KPIDETAIL> vector=new Vector<TblATO_KPIDETAIL>();
if("Y".equals(isPing)){
getParams(params);
CheckConnectionState server=new CheckConnectionState();
String KBP_ID = "10-11-30-10:" + this.NEATENSID + "-SYS";
... ... @@ -342,7 +345,9 @@ public class CollOracleBySql {
String stat=server.getPingState(bean);
collectiondbbase.addKPI(KBP_ID, "FM-00-11-001-999", stat);
log.info(" ************************* getPingStatus ****UNIT_ID ="+KBP_ID+"****stat="+stat+"**");
return collectiondbbase.getKPISet();
vector=collectiondbbase.getKPISet();
}
return vector;
}
... ...
... ... @@ -108,6 +108,8 @@ public class CollLinuxHost implements CollLinuxHostMBean {
*/
public Vector getPing(HashMap params) {
Vector<TblATO_KPIDETAIL> v=new Vector<TblATO_KPIDETAIL>();
String isPing = params.get("isPing")+""; // frank 2017-05-19 添加。Y进行ping操作,N不执行
if("Y".equals(isPing)){
String ip=params.get("IP_ADDR")+"";
if(!StringUtils.isEmpty(ip)){
String connectStatCode="FM-00-10-001-999"; // linux 主机连接状态
... ... @@ -139,6 +141,7 @@ public class CollLinuxHost implements CollLinuxHostMBean {
}
v.add(kpidetail);
}
}
return v;
}
... ... @@ -153,8 +156,6 @@ public class CollLinuxHost implements CollLinuxHostMBean {
public Vector getSSH(HashMap params) {
Vector<TblATO_KPIDETAIL> v=new Vector<TblATO_KPIDETAIL>();
String ip=params.get("IP_ADDR")+"";
String result=server.getPingResultByIp(ip);
if(!StringUtils.isEmpty(result) && "UP".equals(result)){
String loginStatCode="FM-00-10-001-998"; // linux 主机登录状态
ParamterBean bean =new ParamterBean();
String tempPort=params.get("PROTOCOL_PORT")+"";
... ... @@ -188,7 +189,6 @@ public class CollLinuxHost implements CollLinuxHostMBean {
e.printStackTrace();
}
v.add(kpidetail);
}
return v;
}
... ...
... ... @@ -30,6 +30,8 @@ public class CollWindows implements CollWindowsMBean {
*/
public Vector<TblATO_KPIDETAIL> getPingState(HashMap<String, String> params){
Vector<TblATO_KPIDETAIL> v=new Vector<TblATO_KPIDETAIL>();
String isPing = params.get("isPing")+""; // frank 2017-05-19 添加。Y进行ping操作,N不执行
if("Y".equals(isPing)){
String ip=params.get("IP");
if(!StringUtils.isEmpty(ip)){
String kpiId="FM-00-10-001-999"; // Windows 主机连接状态
... ... @@ -60,6 +62,7 @@ public class CollWindows implements CollWindowsMBean {
}
v.add(kpidetail);
}
}
return v;
}
... ... @@ -74,9 +77,6 @@ public class CollWindows implements CollWindowsMBean {
Vector<TblATO_KPIDETAIL> v=new Vector<TblATO_KPIDETAIL>();
String ip=params.get("IP");
if(!StringUtils.isEmpty(ip)){
String result=server.getPingResultByIp(ip);
log.info("@@@@@###### getSnmpState ping result="+ result +"###$$$$$$$$$$%%%%%%%%%%");
if(!StringUtils.isEmpty(result) && "UP".equals(result)){
String kpiId="FM-00-10-001-998"; // Windows 设备登录状态
ParamterBean bean =new ParamterBean();
String tempPort=params.get("PORT");
... ... @@ -100,7 +100,6 @@ public class CollWindows implements CollWindowsMBean {
}
v.add(kpidetail);
}
}
return v;
}
... ...
... ... @@ -70,12 +70,11 @@ public class CollTomcat implements CollTomcatMBean {
*/
@Override
public Vector<TblATO_KPIDETAIL> getPingStatus(HashMap<String, String> params) {
/**
* 该 kbp_class kpiId 如果不存在,需要在页面添加。
*/
String isPing = params.get("isPing")+""; // frank 2017-05-19 添加。Y进行ping操作,N不执行
Vector<TblATO_KPIDETAIL> vector=new Vector<TblATO_KPIDETAIL>();
if("Y".equals(isPing)){
String kbp_class="10-12-13-20";
String kpiId="FM-00-12-001-999";
Vector<TblATO_KPIDETAIL> vector=new Vector<TblATO_KPIDETAIL>();
String jmx_url=params.get("JMX_URL");
int start=jmx_url.indexOf("/rmi://");
int end=jmx_url.lastIndexOf(":");
... ... @@ -96,6 +95,7 @@ public class CollTomcat implements CollTomcatMBean {
} catch (ParseException e){
e.printStackTrace();
}
}
return vector;
}
... ...
... ... @@ -136,17 +136,12 @@ public class CollWebLogic implements CollWebLogicMBean{
@Override
public Vector<TblATO_KPIDETAIL> getPingStatus(HashMap<String, String> params) {
/**
* 该 kbp_class kpiId 如果不存在,需要在页面添加。
*/
String isPing = params.get("isPing"); // frank 2017-05-19 添加。Y进行ping操作,N不执行
Vector<TblATO_KPIDETAIL> vector=new Vector<TblATO_KPIDETAIL>();
if("Y".equals(isPing)){
String kbp_class="10-12-11-20";
String kpiId="FM-00-12-001-999";
Vector<TblATO_KPIDETAIL> vector=new Vector<TblATO_KPIDETAIL>();
String serverip=params.get("SERVERIP");
/**
* SERVERNAME 实际就是 资源标识。
*/
String servername = params.get("SERVERNAME");
String unitId = kbp_class +":"+ Formater.neatenunitid(servername) + "-CONFIG";
CheckConnectionState server=new CheckConnectionState();
... ... @@ -160,6 +155,7 @@ public class CollWebLogic implements CollWebLogicMBean{
} catch (ParseException e){
e.printStackTrace();
}
}
return vector;
}
... ...