diff --git a/ups_alarms/lib/check_mk/base/plugins/agent_based/ups_alarms.py b/ups_alarms/lib/check_mk/base/plugins/agent_based/ups_alarms.py index 2c95c486..f447539e 100644 --- a/ups_alarms/lib/check_mk/base/plugins/agent_based/ups_alarms.py +++ b/ups_alarms/lib/check_mk/base/plugins/agent_based/ups_alarms.py @@ -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", diff --git a/ups_alarms/ups_alarms-1.2.1.mkp b/ups_alarms/ups_alarms-1.2.1.mkp new file mode 100644 index 00000000..93075850 Binary files /dev/null and b/ups_alarms/ups_alarms-1.2.1.mkp differ diff --git a/ups_alarms/ups_alarms-1.2.mkp b/ups_alarms/ups_alarms-1.2.mkp deleted file mode 100644 index b35a2c87..00000000 Binary files a/ups_alarms/ups_alarms-1.2.mkp and /dev/null differ