diff --git a/check_mk/areca/areca-1.1.mkp b/check_mk/areca/areca-1.1.mkp new file mode 100644 index 0000000..4d2a63d Binary files /dev/null and b/check_mk/areca/areca-1.1.mkp differ diff --git a/check_mk/areca/checks/areca_hba_fans b/check_mk/areca/checks/areca_hba_fans index 99d6f96..e964ac7 100644 --- a/check_mk/areca/checks/areca_hba_fans +++ b/check_mk/areca/checks/areca_hba_fans @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | @@ -51,7 +51,7 @@ def check_areca_hba_fans(item, _no_params, info): check_info["areca_hba_fans"] = { "check_function" : check_areca_hba_fans, "inventory_function" : inventory_areca_hba_fans, - "has_perfdata" : True, + "has_perfdata" : False, "service_description" : "Fan %s", # Find Areca SAS MIB "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.18928.1"), diff --git a/check_mk/areca/checks/areca_hba_ldisks b/check_mk/areca/checks/areca_hba_ldisks index 96e3f8d..2a4d3bf 100644 --- a/check_mk/areca/checks/areca_hba_ldisks +++ b/check_mk/areca/checks/areca_hba_ldisks @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | @@ -60,7 +60,7 @@ def check_areca_hba_ldisks(item, _no_params, info): state = 1 else: msg = msg + " - Unhandled state" - return (state, nagios_state_names[state] + " - " + msg) + return (state, msg) return (3, "UNKW - Volset not found in agent output") @@ -68,7 +68,7 @@ def check_areca_hba_ldisks(item, _no_params, info): check_info["areca_hba_ldisks"] = { "check_function" : check_areca_hba_ldisks, "inventory_function" : inventory_areca_hba_ldisks, - "has_perfdata" : True, + "has_perfdata" : False, "service_description" : "Volume set %s", # Find Areca SAS MIB "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.18928.1"), diff --git a/check_mk/areca/checks/areca_hba_pdisks b/check_mk/areca/checks/areca_hba_pdisks index 76a660d..1ded078 100644 --- a/check_mk/areca/checks/areca_hba_pdisks +++ b/check_mk/areca/checks/areca_hba_pdisks @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | @@ -91,7 +91,7 @@ def check_areca_hba_pdisks(item, _no_params, info): check_info["areca_hba_pdisks"] = { "check_function" : check_areca_hba_pdisks, "inventory_function" : inventory_areca_hba_pdisks, - "has_perfdata" : True, + "has_perfdata" : False, "service_description" : "PDisk Enc/Sl %s", # Find Areca SAS MIB "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.18928.1"), diff --git a/check_mk/areca/checks/areca_hba_raidsets b/check_mk/areca/checks/areca_hba_raidsets index 9bc102a..de329cf 100644 --- a/check_mk/areca/checks/areca_hba_raidsets +++ b/check_mk/areca/checks/areca_hba_raidsets @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | @@ -52,7 +52,7 @@ def check_areca_hba_raidsets(item, _no_params, info): state = 3 msg = "%s is %s. (members: %s)" % (rs_name, rs_state, rs_mem_names) - return (state, nagios_state_names[state] + " - " + msg) + return (state, msg) return (3, "UNKW - Raidset not found in agent output") @@ -60,7 +60,7 @@ def check_areca_hba_raidsets(item, _no_params, info): check_info["areca_hba_raidsets"] = { "check_function" : check_areca_hba_raidsets, "inventory_function" : inventory_areca_hba_raidsets, - "has_perfdata" : True, + "has_perfdata" : False, "service_description" : "Raid set %s", # Find Areca SAS MIB "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.18928.1"), diff --git a/check_mk/areca/checks/areca_hba_temp b/check_mk/areca/checks/areca_hba_temp index 45e32b9..e81f268 100644 --- a/check_mk/areca/checks/areca_hba_temp +++ b/check_mk/areca/checks/areca_hba_temp @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | @@ -83,7 +83,7 @@ # snmp_info : oid(".1.3.6.1.4.1.18928.1.2.2.1.10.1"), [ "1", "2", "3" ] # default levels will not work well in this check -areca_hba_temp_default_levels = (40, 45) +areca_hba_temp_default_levels = (63, 69) def inventory_areca_hba_temp(info): inventory = [] for line in info[0]: @@ -109,8 +109,8 @@ def check_areca_hba_temp(item, params, info): else: state = 0 - perfdata = [ ( item, temp, warn, crit, 0 ) ] - return (state, nagios_state_names[state] + " - Temperature is %dC" % temp, perfdata) + perfdata = [ ( "temp", temp, warn, crit ) ] + return (state, "Temperature is %dC" % temp, perfdata) return (3, "UNKNOWN - sensor not found in agent output") diff --git a/check_mk/areca/checks/areca_hba_voltages b/check_mk/areca/checks/areca_hba_voltages index f2575c2..1fe6a04 100644 --- a/check_mk/areca/checks/areca_hba_voltages +++ b/check_mk/areca/checks/areca_hba_voltages @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | @@ -92,14 +92,15 @@ def inventory_areca_hba_voltages(info): def check_areca_hba_voltages(item, _no_params, info): areca_info = parse_areca(info, "voltages") + epsilon = 10 if item in areca_info["voltages"].keys(): # i'm fetching the voltage from the label and try to alert on the difference. - v_cur = float(areca_info["voltages"][item]) - v_rated = float(item.split()[-1].replace("V", "")) * 1000 - perfdata = [ ( item, v_rated, v_cur, 0, 0 ) ] + v_cur = float(areca_info["voltages"][item]) / 1000.0 + v_rated = float(item.split()[-1].replace("V", "")) + perfdata = [ ( "voltage", v_cur ) ] # this is now just a hardcoded level, could be improved. - if v_cur < v_rated - v_rated / 100*5 or v_cur > v_rated + v_rated / 100*5: - return (1, "WARNING - Voltage is %02fV" % v_cur, perfdata) + if v_cur < v_rated - v_rated / 100*epsilon or v_cur > v_rated + v_rated / 100*epsilon: + return (1, "WARNING - Voltage is %02.3fV" % v_cur, perfdata) else: return (0, "OK - Voltage is ok", perfdata) return (3, "UNKNOWN - Voltage sensor not found in agent output")