Module: check_mk
Branch: master
Commit: d51a8235e2d73fafd731eafdff9fa310d7a32798
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d51a8235e2d73f…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Fri Dec 14 14:32:12 2012 +0100
fileinfo / cpl_airlaiser no longer crash when no check info is given
---
checks/cbl_airlaser | 4 +++-
checks/fileinfo | 6 ++++++
2 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/checks/cbl_airlaser b/checks/cbl_airlaser
index 650bc58..41200e2 100644
--- a/checks/cbl_airlaser
+++ b/checks/cbl_airlaser
@@ -177,10 +177,12 @@ def inventory_cbl_airlaser(info):
def check_cbl_airlaser_status(item, _no_params, info):
+ if len(info) == 0:
+ return (3, "UNKNOWN - no information sent by agent")
+
selftest, chassis, power, module, optrx, opttx = info
status = selftest[0][0]
-
if status == "1":
return (0, "OK - Airlaser: normal operation")
elif status == "2":
diff --git a/checks/fileinfo b/checks/fileinfo
index 6086fce..0ab6760 100644
--- a/checks/fileinfo
+++ b/checks/fileinfo
@@ -76,6 +76,9 @@ def fileinfo_patterns_of_group(group):
return patterns
def check_fileinfo(item, params, info):
+ if len(info) == 0:
+ return (3, "UNKNOWN - no information sent by agent")
+
reftime = int(info[0][0])
check_definition = False
for line in info[1:]:
@@ -94,8 +97,11 @@ def check_fileinfo(item, params, info):
return fileinfo_check_function(check_definition, params)
def check_fileinfogroups(item, params, info):
+ if len(info) == 0:
+ return (3, "UNKNOWN - no information sent by agent")
import fnmatch
reftime = int(info[0][0])
+
count_all = 0
age_oldest = None
age_newest = 0