Skip to content

Commit

Permalink
fixes issue #168
Browse files Browse the repository at this point in the history
  • Loading branch information
gurubert committed Sep 30, 2024
1 parent a0a5f71 commit 039e972
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,18 @@ def parse_ups_alarms(string_table):
'.1.3.6.1.2.1.33.1.6.3.23': 'Shutdown Imminent',
'.1.3.6.1.2.1.33.1.6.3.24': 'Test In Progress',
}
section = {'count': None}

if len(string_table) == 2:
section = {'count': 0, 'alarms': []}
if len(string_table[0]) == 1:
section['count'] = int(string_table[0][0][0])
if len(string_table[1]) > 0 and section['count'] > 0:
section['alarms'] = []
for line in string_table[1]:
section['alarms'].append((parse_snmp_uptime(line[1]), transUpsAlarm.get(line[0], 'Unknown')))

if section['count'] == None:
return section
else:
return None
return section

register.snmp_section(
name="ups_alarms",
Expand Down
Binary file added ups_alarms/ups_alarms-1.2.1.mkp
Binary file not shown.
Binary file removed ups_alarms/ups_alarms-1.2.mkp
Binary file not shown.

0 comments on commit 039e972

Please sign in to comment.