Skip to content

Commit

Permalink
fix: use oid_index if oid is empty (#52)
Browse files Browse the repository at this point in the history
Fixed oid showing name instead of oid numerical values
  • Loading branch information
dropthemic authored Jan 8, 2024
1 parent 466a9c8 commit 1e704df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions check_synology.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def exitCode():
output = ''
perfdata = '|'
for item in snmpwalk('1.3.6.1.4.1.6574.2.1.1.2'):
i = item.oid.split('.')[-1]
i = item.oid_index or item.oid.split('.')[-1]
disk_name = item.value
disk_status_nr = snmpget('1.3.6.1.4.1.6574.2.1.1.5.' + str(i))
disk_temp = snmpget('1.3.6.1.4.1.6574.2.1.1.6.' + str(i))
Expand Down Expand Up @@ -190,7 +190,7 @@ def exitCode():
output = ''
perfdata = '|'
for item in snmpwalk('1.3.6.1.2.1.25.2.3.1.3'):
i = item.oid.split('.')[-1]
i = item.oid_index or item.oid.split('.')[-1]
storage_name = item.value
if re.match("/volume(?!.+/@docker.*)", storage_name):
allocation_units = snmpget('1.3.6.1.2.1.25.2.3.1.4.' + str(i))
Expand Down

0 comments on commit 1e704df

Please sign in to comment.