Skip to content

Commit

Permalink
fix: stop search for enterprise oid (#888)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajasnosz authored Oct 11, 2023
1 parent 866f276 commit 5d0d9b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

### Fixed
- empty profile name when MIB family name and a polled varbind differs
- stop mib search on vendor if oid is for enterprise tree

## [1.9.2]

Expand Down
5 changes: 2 additions & 3 deletions splunk_connect_for_snmp/snmp/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,10 +390,9 @@ def load_mibs(self, mibs: List[str]) -> None:
logger.warning(f"Error loading mib for {mib}, {e}")

def is_mib_known(self, id: str, oid: str, target: str) -> Tuple[bool, str]:

oid_list = tuple(oid.split("."))

start = 5
# if oid match enterprise, then search should stop if there is no match to vendor
start = 6 if oid.startswith("1.3.6.1.4.1") else 5
for i in range(len(oid_list), start, -1):
oid_to_check = ".".join(oid_list[:i])
if oid_to_check in self.mib_map:
Expand Down

0 comments on commit 5d0d9b9

Please sign in to comment.