Module: check_mk
Branch: master
Commit: d1df143f24cd4e6c32c1473f8536209baaf0e09d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d1df143f24cd4e…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Thu Jul 5 10:55:28 2018 +0200
Minor cleanup
Change-Id: I4c7597685c3b7a6ae2b0b15dadf3f29053ef4138
---
checks/aix_diskiod | 13 +++++--------
checks/hpux_lunstats | 15 +++++++--------
2 files changed, 12 insertions(+), 16 deletions(-)
diff --git a/checks/aix_diskiod b/checks/aix_diskiod
index 78e21c0..bc86746 100644
--- a/checks/aix_diskiod
+++ b/checks/aix_diskiod
@@ -44,7 +44,7 @@
# 5. Kb_read -> Kilobytes read since system boot
# 6. Kb_wrtn -> Kilobytes written since system boot
-def aix_diskiod_convert(info):
+def parse_aix_diskiod(info):
#TODO use 'check_diskstat_dict' which needs the following format
# disks = { "sda" : {
# 'node' : None,
@@ -70,20 +70,17 @@ def aix_diskiod_convert(info):
return converted
-def inventory_aix_diskiod(info):
- return inventory_diskstat_generic(aix_diskiod_convert(info))
+def check_aix_diskiod(item, params, parsed):
+ return check_diskstat_generic(item, params, time.time(), parsed,
mode='bytes')
-def check_aix_diskiod(item, params, info):
- return check_diskstat_generic(item, params, time.time(), aix_diskiod_convert(info),
mode='bytes')
-
check_info["aix_diskiod"] = {
+ 'parse_function': parse_aix_diskiod,
'check_function': check_aix_diskiod,
- 'inventory_function': inventory_aix_diskiod,
+ 'inventory_function': inventory_diskstat_generic,
'service_description': 'Disk IO %s',
'has_perfdata': True,
'node_info': True,
'group': 'disk_io',
'includes': [ "diskstat.include" ],
}
-
diff --git a/checks/hpux_lunstats b/checks/hpux_lunstats
index a76addc..33d0708 100644
--- a/checks/hpux_lunstats
+++ b/checks/hpux_lunstats
@@ -47,10 +47,8 @@
# STATISTICS FOR LUN :/dev/rdisk/disk6
-check_includes['hpux_lunstats'] = [ "diskstat.include" ]
-
# Convert info to output needed for generic diskstat check
-def hpux_lunstats_convert(info):
+def parse_hpux_lunstats(info):
#TODO use 'check_diskstat_dict' which needs the following format
# disks = { "sda" : {
# 'node' : None,
@@ -84,16 +82,17 @@ def hpux_lunstats_convert(info):
luns.append((None, lun, bytes_read, bytes_written))
return luns
-def check_hpux_lunstats(item, params, info):
- return check_diskstat_generic(item, params, time.time(),
hpux_lunstats_convert(info))
-def inventory_hpux_lunstats(info):
- return inventory_diskstat_generic(hpux_lunstats_convert(info))
+def check_hpux_lunstats(item, params, parsed):
+ return check_diskstat_generic(item, params, time.time(), parsed)
+
check_info["hpux_lunstats"] = {
+ 'parse_function': parse_hpux_lunstats,
'check_function': check_hpux_lunstats,
- 'inventory_function': inventory_hpux_lunstats,
+ 'inventory_function': inventory_diskstat_generic,
'service_description': 'Disk IO %s',
'has_perfdata': True,
'group': 'disk_io',
+ 'includes': [ "diskstat.include" ],
}