[checkmk-commits] Check_MK Git: check_mk: fileinfo: fixed exception when outof_range_txt was none

Andreas Boesl ab at mathias-kettner.de
Fri Feb 13 14:10:58 CET 2015


Module: check_mk
Branch: master
Commit: 88d01546740bde7aeed765f5ac45c5a307318a51
URL:    http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=88d01546740bde7aeed765f5ac45c5a307318a51

Author: Andreas Boesl <ab at mathias-kettner.de>
Date:   Fri Feb 13 14:10:39 2015 +0100

fileinfo: fixed exception when outof_range_txt was none

---

 checks/fileinfo |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/checks/fileinfo b/checks/fileinfo
index 281f6b9..b625db3 100644
--- a/checks/fileinfo
+++ b/checks/fileinfo
@@ -114,7 +114,7 @@ def check_fileinfo(item, params, info):
     for line in info[1:]:
         if item == line[0]:
             if line[1] == "missing":
-                return in_timerange and 3 or 0, "File not found" + outof_range_txt
+                return in_timerange and 3 or 0, "File not found" + (outof_range_txt or "")
             state = 0
             size = int(line[1])
             age = reftime - int(line[2])
@@ -124,7 +124,7 @@ def check_fileinfo(item, params, info):
                 ("age",  age,  get_age_human_readable) ]
 
     if check_definition == False:
-        return in_timerange and 3 or 0, "File not found" + outof_range_txt
+        return in_timerange and 3 or 0, "File not found" + (outof_range_txt or "")
     return fileinfo_check_function(check_definition, params, outof_range_txt)
 
 # Extracts patterns that are relevant for the current host and item.



More information about the checkmk-commits mailing list