Skip to content

Commit

Permalink
update windows define and accept snmp leaf (#1379)
Browse files Browse the repository at this point in the history
  • Loading branch information
jinyaoMa authored Dec 4, 2023
1 parent ee361c7 commit b3623b4
Show file tree
Hide file tree
Showing 2 changed files with 172 additions and 106 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
import org.springframework.util.StringUtils;

import java.io.IOException;
import java.nio.Buffer;
import java.nio.charset.Charset;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutionException;
Expand Down Expand Up @@ -181,6 +183,15 @@ public void collect(CollectRep.MetricsData.Builder builder, long monitorId, Stri
} else {
String oid = oidMap.get(alias);
String value = oidsValueMap.get(oid);
if (value == null) {
// get leaf
for (String key : oidsValueMap.keySet()) {
if (key.startsWith(oid)){
value = oidsValueMap.get(key);
break;
}
}
}
if (value != null) {
valueRowBuilder.addColumns(value);
} else {
Expand Down
Loading

0 comments on commit b3623b4

Please sign in to comment.