Module: check_mk
Branch: master
Commit: a72861bad1efdab3ec8f212a63fb87c3baf96188
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a72861bad1efda…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sat Oct 24 15:47:09 2015 +0200
Code cleanup: remove some unneccessary imports in checks
---
checks/ad_replication | 2 +-
checks/fileinfo | 8 ++++----
checks/heartbeat_crm | 2 +-
checks/jar_signature | 2 +-
checks/smbios_sel | 2 +-
5 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/checks/ad_replication b/checks/ad_replication
index c89a740..411f33f 100644
--- a/checks/ad_replication
+++ b/checks/ad_replication
@@ -36,7 +36,7 @@
#
showrepl_INFO,Standardname-des-ersten-Standorts,WIN2003,"CN=Schema,CN=Configuration,DC=corp,\
#DC=de",Standardname-des-ersten-Standorts,WIN2003-DC2,RPC,0,0,2010-07-02 12:46:28,0
-import datetime, time
+import datetime
ad_replication_default_params = (15,20)
diff --git a/checks/fileinfo b/checks/fileinfo
index 43c6a29..a1c3f2d 100644
--- a/checks/fileinfo
+++ b/checks/fileinfo
@@ -146,7 +146,6 @@ def check_fileinfo_groups(item, params, info):
outof_range_txt = fileinfo_check_timeranges(params)
- # TODO: import in check functions is not allowed
reftime = int(info[0][0])
count_all = 0
@@ -207,8 +206,6 @@ def check_fileinfo_groups(item, params, info):
return fileinfo_check_function(check_definition, params, outof_range_txt)
def fileinfo_check_function(check_definition, params, outof_range_txt):
- # TODO: use lambda a, b: a<b instead....
- import operator
state = 0
infos = []
perfdata = []
@@ -216,7 +213,10 @@ def fileinfo_check_function(check_definition, params,
outof_range_txt):
infos.append("%s is %s" % (what, verbfunc(val)))
if type(val) in [long, int]: # because strings go into infos but not into
perfdata
warn, crit = "", ""
- for how, comp, cfunc in [ ("min", "<", operator.lt),
("max", ">", operator.gt) ]:
+ for how, comp, cfunc in [
+ ("min", "<", lambda a, b: a < b),
+ ("max", ">", lambda a, b: a > b),
+ ]:
p = params.get(how + what)
if p:
warn, crit = p
diff --git a/checks/heartbeat_crm b/checks/heartbeat_crm
index c567a59..cbd943b 100644
--- a/checks/heartbeat_crm
+++ b/checks/heartbeat_crm
@@ -42,7 +42,7 @@
# resource_slapmaster (ocf::heartbeat:OpenLDAP): Started mwp
# resource_slapslave (ocf::heartbeat:OpenLDAP): Started smwp
-import time, datetime
+import datetime
# Nails down the DC to the node which is the DC during inventory. The check
# will report CRITICAL when another node becomes the DC during later checks.
diff --git a/checks/jar_signature b/checks/jar_signature
index 8070cb2..cbe0440 100644
--- a/checks/jar_signature
+++ b/checks/jar_signature
@@ -24,7 +24,7 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-import datetime, time
+import datetime
def inventory_jar_signature(info):
inventory = []
diff --git a/checks/smbios_sel b/checks/smbios_sel
index 380124d..3c38325 100644
--- a/checks/smbios_sel
+++ b/checks/smbios_sel
@@ -66,7 +66,7 @@
# 0xFF End-of-Log
#};
-import datetime, time
+import datetime
smbios_sel_msg_types = {
#Type: (Number-of-Entries Threshold, Status-Code, Current Count, Last Entry, Alias)