Module: check_mk
Branch: master
Commit: 0a46086f97e6787949ab0d8b38a7ebed2b6086e0
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0a46086f97e678…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Wed May 24 11:15:59 2017 +0200
4663 FIX: check_mailboxes: Removed useless report_age which causes TypeError: float()
argument must be a string or a number
Change-Id: I24d1ce2efaf61649a63899c93e0335af2a71afc8
---
.werks/4663 | 11 +++++++++++
active_checks/check_mailboxes | 3 +--
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/.werks/4663 b/.werks/4663
new file mode 100644
index 0000000..e237786
--- /dev/null
+++ b/.werks/4663
@@ -0,0 +1,11 @@
+Title: check_mailboxes: Removed useless report_age which causes TypeError: float()
argument must be a string or a number
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1495617082
+
+
diff --git a/active_checks/check_mailboxes b/active_checks/check_mailboxes
index ece1a17..f460bc9 100755
--- a/active_checks/check_mailboxes
+++ b/active_checks/check_mailboxes
@@ -242,7 +242,6 @@ def main(options):
old_mails = imap.mails(mb, before=(now - options.warn_age) + 86400)
if old_mails:
old_mails = old_mails[:options.retrieve_max]
- report_age = None
status = 0
status_icon = ""
for mail in old_mails:
@@ -252,7 +251,7 @@ def main(options):
status = 2
status_icon = "(!!) "
break
- elif float(age) >= options.warn_age and float(age) >
float(report_age):
+ elif float(age) >= options.warn_age:
report_age = age
status = 1
status_icon = "(!) "