Module: check_mk
Branch: master
Commit: 0303cf184afe0c9c8d819913f730145535ce58a1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0303cf184afe0c…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Dec 17 15:24:02 2015 +0100
removed obsolete function
---
checks/netapp_api.include | 78 ---------------------------------------------
1 file changed, 78 deletions(-)
diff --git a/checks/netapp_api.include b/checks/netapp_api.include
index bbc28a3..cf8ea5b 100644
--- a/checks/netapp_api.include
+++ b/checks/netapp_api.include
@@ -51,81 +51,3 @@ def netapp_api_parse_lines(info, custom_keys = [], as_dict_list =
False):
return instances
-# Converts the given info into
-# - A config dictionary with config_key as identifier. If the counter_key of the
-# counter section matches the config_key the counter information is merged into
-# the config.
-# - With counter_as_key you can specify whether the counter_key entries
-# should used as main keys in the returned dictionary
-def netapp_api_convert_info(info, configs = {}, counter_key = None, counter_as_key =
False):
- lines = iter(info)
- try:
- is_config = False
- current_instance = None
- current_config = None
-
- current_counter = {}
- objects = {}
- last_config_name = [""]
-
- def add_config():
- if current_config == None:
- return
- key = current_config.get(configs.get(current_instance,
{}).get("key"))
- if key:
- objects.setdefault(current_instance, {})
- objects[current_instance][key] = current_config
- last_config_name[0] = key
-
- def add_counter():
- if not current_counter:
- return
- counter_name = current_counter.get(counter_key)
- if not counter_name:
- return
-
- if counter_as_key:
- objects[counter_name] = current_counter
- elif counter_name in objects[current_instance]:
- objects[current_instance][counter_name]["counters"] =
current_counter
-
- while True:
- line = lines.next()
- if line[0] == "[config_instance]":
- add_config()
- add_counter()
- current_counter = {}
- is_config = True
- current_instance = line[-1]
- continue
- elif line[0] == "[counter_instance]":
- add_config()
- add_counter()
- current_config = {}
- is_config = False
- continue
-
- if is_config:
- if line[-1] == configs.get(current_instance,
{}).get("block-name"):
- add_config()
- current_config = {}
- elif current_config != None and len(line) >= 2:
- key = line[0]
- if current_config.get(key):
- continue
- else:
- current_config[key] = line[1]
- else: # is counter
- if line[-1] == "---new_counter---":
- add_counter()
- current_counter = {}
- elif len(line) == 2:
- current_counter[line[0]] = line[1]
-
- except StopIteration:
- add_config()
- add_counter()
- pass
-
- return objects
-