Module: check_mk
Branch: master
Commit: 4122c5314f4fced4e7df05203429dd853f65d00b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4122c5314f4fce…
Author: Florian Kromer <fk(a)mathias-kettner.de>
Date: Tue Jan 8 13:08:56 2019 +0100
cleanup from unused functions in checks
Change-Id: I93f0562dc2e642b22f839abab016e9305de037d8
---
checks/brocade.include | 7 ----
checks/cmciii.include | 6 ---
checks/dell_poweredge.include | 8 ----
checks/ewon | 93 -------------------------------------------
checks/oracle_crs_res | 19 ---------
checks/temperature.include | 4 --
6 files changed, 137 deletions(-)
diff --git a/checks/brocade.include b/checks/brocade.include
index 390d809..aeda7c2 100644
--- a/checks/brocade.include
+++ b/checks/brocade.include
@@ -62,10 +62,3 @@ def brocade_fcport_getitem(number_of_ports, index, portname, is_isl,
settings):
if portname.strip() and uses_portname:
itemname += " " + portname.strip()
return itemname
-
-
-# Inverse to the above. Caveat: Maps back to an index that starts with 1,
-# as the SNMP tables in brocade_fcport and brocade_sfp are indexed this way.
-# TODO: Check whether we can simplify brocade_fcport a bit using this.
-def brocade_item_to_port_number(item):
- return int(item.split()[0]) + 1
diff --git a/checks/cmciii.include b/checks/cmciii.include
index b5617b8..6c2b16e 100644
--- a/checks/cmciii.include
+++ b/checks/cmciii.include
@@ -25,12 +25,6 @@
# Boston, MA 02110-1301 USA.
-def cmciii_get_unit_number(units, unit_name):
- namelist = map(list, zip(*units))[1]
- if unit_name in namelist:
- return str(namelist.index(unit_name) + 1)
-
-
def extract_cmciii_lcp_temps(liste):
miste = []
for l in liste:
diff --git a/checks/dell_poweredge.include b/checks/dell_poweredge.include
index 2ac4ef6..db1454b 100644
--- a/checks/dell_poweredge.include
+++ b/checks/dell_poweredge.include
@@ -264,14 +264,6 @@ def inventory_dell_poweredge_amperage_power(info):
return inventory
-def inventory_dell_poweredge_amperage_current(info):
- inventory = []
- for line in info:
- if line[6] != "" and line[5] in ("23", "25"):
- inventory.append((line[6], None))
- return inventory
-
-
def check_dell_poweredge_amperage(item, _no_params, info):
for _chassisIndex, _Index, _StateSettings, Status, Reading, ProbeType, LocationName,
\
UpperCritical, UpperNonCritical in info:
diff --git a/checks/ewon b/checks/ewon
index 5b19566..75aacf9 100644
--- a/checks/ewon
+++ b/checks/ewon
@@ -199,99 +199,6 @@ oxyreduct_tag_map = {
}
-def inventory_oxyreduct(parsed):
- for name, area_info in parsed.iteritems():
- tagids = area_info.keys()
- if min(tagids) < 10:
- yield name, {}
- else:
- # for the "optional" rooms the lsb of the last bitmask says whether
the room is used
- flags = int(area_info[max(tagids)])
- if flags % 2 == 1:
- yield name, {}
-
-
-def check_oxyreduct(item, params, parsed):
- def to_binary(n):
- return ''.join(str(1 & int(n) >> i) for i in range(16)[::-1])
-
- found = False
- returned = False
-
- if item in parsed:
- for tagid, value in parsed[item].iteritems():
- ref_tagid = tagid
- found = True
- if ref_tagid > 17:
- ref_tagid = ((ref_tagid - 18) % 8) + 10
-
- tag_params = oxyreduct_tag_map.get(ref_tagid)
-
- # resolve tag parameters where multiple tags follow the same pattern
- if "same_as" in tag_params:
- ref_tag_id = tag_params["same_as"]
- tag_params = oxyreduct_tag_map[ref_tag_id]
-
- # if it's a measure, check levels
- if "name" in tag_params:
- if "condition_flag" in tag_params:
- condition_tagid = tagid + tag_params["condition_flag"][0]
- if not int(parsed[item][condition_tagid]) &
tag_params["condition_flag"][1]:
- continue
- value = int(value)
- unit = tag_params.get("unit", "")
- status = 0
- if "scale" in tag_params:
- value = float(value) * tag_params["scale"]
-
- if "levels_name" in tag_params and
tag_params["levels_name"] in params:
- warn, crit, warn_lower, crit_lower =
params[tag_params["levels_name"]]
-
- elif "levels" in tag_params:
- warn, crit, warn_lower, crit_lower = tag_params["levels"]
-
- if warn and crit and warn_lower and crit_lower:
- if (value >= crit) or (value <= crit_lower):
- status = 2
- elif (value >= warn) or (value <= warn_lower):
- status = 1
-
- levels_text = ""
- if status != 0:
- levels_text = " (warn/crit at %s%s/%s%s and below
%s%s/%s%s)" %\
- (warn, unit, crit, unit, warn_lower, unit, crit_lower, unit)
-
- perfdata = []
- if "perfvar" in tag_params:
- perfdata.append((tag_params["perfvar"], value, warn,
crit))
- yield status, "%s%s %s%s" %\
- (value, unit, tag_params["name"], levels_text), perfdata
- returned = True
-
- # if it's a bitmask, try to determine if they are good flags
- if "flags" in tag_params:
- value_bin = to_binary(value)
- for i in range(len(tag_params["flags"])):
- if value_bin[i] == "1":
- state = "active"
- else:
- state = "inactive"
-
- if tag_params["flags"][i] in ["1", "0"]
and\
- tag_params["flags"][i] != value_bin[i]:
- returned = True
- yield 2, "%s %s" %
(tag_params["flag_names"][i], state)
- elif tag_params["flags"][i] == "*":
- returned = True
- yield 0, "%s %s" %
(tag_params["flag_names"][i], state)
- elif tag_params["flags"][i] == "+" and
value_bin[i] == "1":
- returned = True
- yield 0, "%s" % tag_params["flag_names"][i]
-
- if found and not returned:
- yield 0, "no messages"
-
-
def parse_ewon(info):
result = {}
for tagid, value, name in info:
diff --git a/checks/oracle_crs_res b/checks/oracle_crs_res
index 8843c96..2d7745f 100644
--- a/checks/oracle_crs_res
+++ b/checks/oracle_crs_res
@@ -80,25 +80,6 @@ def inventory_oracle_crs_res(parsed):
return [(name, None) for name in parsed[1]]
-def get_oracle_crs_runninginfo(item, data):
- infotext = ''
- for line in data:
- resname = line[0]['NAME']
- resstate = line[0]['STATE'].split(' ', 1)[0]
- nodename = line[1]
-
- if item == resname and nodename not in ('nodename', 'csslocal',
'crslocal') \
- and resstate == 'ONLINE':
-
- # sometime there is only 'ONLINE' instead 'ONLINE on
<nodename>'
- # prevent duplicate entries
- infotextshort = ' [online on %s]' % (nodename)
- if infotextshort not in infotext:
- infotext += infotextshort
-
- return infotext
-
-
def check_oracle_crs_res(item, _no_params, parsed):
_crs_nodename, ressources = parsed
diff --git a/checks/temperature.include b/checks/temperature.include
index 469ec87..903c908 100644
--- a/checks/temperature.include
+++ b/checks/temperature.include
@@ -67,10 +67,6 @@ def to_celsius(reading, unit, relative=False):
return reading
-def convert_unit_relative(value, in_unit, out_unit):
- return from_celsius(to_celsius(value, in_unit, relative=True), out_unit,
relative=True)
-
-
# Format number according to its datatype
def render_temp(n, output_unit, relative=False):
t = from_celsius(n, output_unit, relative)