diff --git a/com.creditease.uav.agent/src/main/java/com/creditease/agent/feature/logagent/RuleFilterFactory.java b/com.creditease.uav.agent/src/main/java/com/creditease/agent/feature/logagent/RuleFilterFactory.java index 406403e2..927067d0 100644 --- a/com.creditease.uav.agent/src/main/java/com/creditease/agent/feature/logagent/RuleFilterFactory.java +++ b/com.creditease.uav.agent/src/main/java/com/creditease/agent/feature/logagent/RuleFilterFactory.java @@ -97,14 +97,14 @@ public LogFilterAndRuleBuilder newBuilder() { protected List getAidLogFilterAndRuleList(String id) { - id = id.replace('\\', '/'); + // id = id.replace('\\', '/'); return aidlogcollection.getIfPresent(id); } // this key should be absFilePath --- by hongqiang public LogFilterAndRule getLogFilterAndRule(String id) { - id = id.replace('\\', '/'); + // id = id.replace('\\', '/'); LogFilterAndRule lfar = null; lfar = logcollection.getIfPresent(id); @@ -275,9 +275,10 @@ public LogFilterAndRule build(String classname) { AppLogPatternInfoCollection profileMap = logAgent.getLatestLogProfileDataMap(); LogPatternInfo logPatternInfo = profileMap.get(serverid + "-" + appid, serverid + "-" + appid + "-" + logid); - logcollection.put(logPatternInfo.getAbsolutePath(), mainLogFAR); - if (aidLogFARlist != null) - aidlogcollection.put(logPatternInfo.getAbsolutePath(), aidLogFARlist); + pubLogFilterAndRule(logPatternInfo.getAbsolutePath(), mainLogFAR); + if (aidLogFARlist != null) { + pubAidLogFilterAndRule(logPatternInfo.getAbsolutePath(), aidLogFARlist); + } return mainLogFAR; } @@ -382,6 +383,14 @@ public void pubLogFilterAndRule(String id, LogFilterAndRule lfar) { logcollection.put(id, lfar); } + public void pubAidLogFilterAndRule(String id, List lfar) { + + // 保证路径不存在多余的'/'等 + id = new File(id).getAbsolutePath(); + + aidlogcollection.put(id, lfar); + } + public boolean hasLogFilterAndRule(String id) { LogFilterAndRule lfar = logcollection.getIfPresent(id); diff --git a/com.creditease.uav.healthmanager/src/main/java/com/creditease/uav/feature/runtimenotify/scheduler/NodeInfoWatcher.java b/com.creditease.uav.healthmanager/src/main/java/com/creditease/uav/feature/runtimenotify/scheduler/NodeInfoWatcher.java index 9e59f8bd..e3937154 100644 --- a/com.creditease.uav.healthmanager/src/main/java/com/creditease/uav/feature/runtimenotify/scheduler/NodeInfoWatcher.java +++ b/com.creditease.uav.healthmanager/src/main/java/com/creditease/uav/feature/runtimenotify/scheduler/NodeInfoWatcher.java @@ -346,13 +346,14 @@ private void judgeProcCrash() { String[] procKeyBakArray = procKeyBak.split("_", -1); String ipBak = procKeyBakArray[0]; String nameBak = procKeyBakArray[1]; - List portsBak = new ArrayList(Arrays.asList(procKeyBakArray[2].split(":"))); if (procKeyBakArray[2].equals("") || !(ipBak + nameBak).equals(ip + name) || procKeyBak.equals(procKey) || delKeys.contains(procKeyBak)) { continue; } + List portsBak = new ArrayList(Arrays.asList(procKeyBakArray[2].split(":"))); + for (String port : ports) { if (portsBak.contains(port)) { if (time >= timeBak) { @@ -579,7 +580,7 @@ private Map buildMDF(String node) { /** * 拼接判断进程死亡所用的key * - * 1.存在固定端口进程 ip_name_port:port:__ + * 1.存在固定端口进程 ip_name_port#port#__ * * 2.不存在固定端口的非java进程 ip_name___ * @@ -643,7 +644,7 @@ private void putDiskInfo(Map infoMap) { Map dv = (Map) disk.get(dk); for (String dvk : dv.keySet()) { String dvv = dv.get(dvk).toString(); - if ("useRate".equals(dvk)||"useRateInode".equals(dvk)) { + if ("useRate".equals(dvk) || "useRateInode".equals(dvk)) { dvv = dvv.replace("%", ""); // cut '%' } infoMap.put("os.io.disk" + pk + dvk, dvv);