diff --git a/local/lib/python3/cmk/base/plugins/agent_based/mailcow_mailboxes.py b/local/lib/python3/cmk/base/plugins/agent_based/mailcow_mailboxes.py index 8eebb78..18f9f0c 100644 --- a/local/lib/python3/cmk/base/plugins/agent_based/mailcow_mailboxes.py +++ b/local/lib/python3/cmk/base/plugins/agent_based/mailcow_mailboxes.py @@ -93,12 +93,16 @@ def parse_mailcow_mailboxes_section(string_table): display_name = line[4] # number of messages within mailbox number_of_messages = int(line[5]) - # percent in use, rounded to full percent - percent_in_use = int(line[6]) # calculate storage used for all messages in mailbox quota = int(line[7]) - total_number_of_bytes_used = int(line[8]) - percent_storage_used_for_messages = total_number_of_bytes_used * 100 / quota + if quota == 0: + # quota is not set, if this is the case, line[6] contains no numeric value, but the char "-" + percent_in_use = 0 + else: + total_number_of_bytes_used = int(line[8]) + percent_storage_used_for_messages = total_number_of_bytes_used * 100 / quota + # percent in use, rounded to full percent + percent_in_use = int(line[6]) # get time of last login for IMAP/POP3/SMTP (seconds since epoch) last_imap_login = int(line[9]) last_pop3_login = int(line[10]) diff --git a/mkp/Mailcow-1.1.3.mkp b/mkp/Mailcow-1.1.3.mkp new file mode 100755 index 0000000..0ee707e Binary files /dev/null and b/mkp/Mailcow-1.1.3.mkp differ