Module: check_mk
Branch: master
Commit: 6c0dc8e81f92ab53da1571417add06bbd25d2eab
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6c0dc8e81f92ab…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Oct 19 08:45:09 2015 +0200
#2682 FIX Fixed exception Error creating configuration: global name
'extra_host_attributes' is not defined
---
.werks/2682 | 10 ++++++++++
ChangeLog | 5 +++++
modules/check_mk.py | 12 ++++++++++++
3 files changed, 27 insertions(+)
diff --git a/.werks/2682 b/.werks/2682
new file mode 100644
index 0000000..6ee3614
--- /dev/null
+++ b/.werks/2682
@@ -0,0 +1,10 @@
+Title: Fixed exception Error creating configuration: global name
'extra_host_attributes' is not defined
+Level: 2
+Component: core
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i4
+Date: 1445237097
+
+
diff --git a/ChangeLog b/ChangeLog
index 56bf526..157be51 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
1.2.7i4:
+ Core & Setup:
+ * 2682 FIX: Fixed exception Error creating configuration: global name
'extra_host_attributes' is not defined
+
Checks & Agents:
+ * 2434 NetApp monitoring: Cluster-Mode is now supported, changes in existing 7Mode
checks...
+ NOTE: Please refer to the migration notes!
* 2695 hp_msa_disk, hp_msa_volume: these checks now report more information about
disks and volumes of a HP MSA 2040 Storage System
* 2663 knuerr_rms_temp: switch to new generic temperature logic, allow e.g. lower
levels...
NOTE: Please refer to the migration notes!
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 44d4ed3..2cd3041 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -773,6 +773,17 @@ def fallback_ip_for(hostname, family=None):
return "::"
+def extra_host_attributes(hostname):
+ attrs = {}
+ for key, conflist in extra_host_conf.items():
+ values = host_extra_conf(hostname, conflist)
+ if values:
+ if key[0] == "_":
+ key = key.upper()
+ attrs[key] = values[0]
+ return attrs
+
+
#.
# .--SNMP----------------------------------------------------------------.
# | ____ _ _ __ __ ____ |
@@ -1892,6 +1903,7 @@ def host_extra_conf_merged(hostname, conf):
rule_dict.setdefault(key, value)
return rule_dict
+
def in_binary_hostlist(hostname, conf):
# if we have just a list of strings just take it as list of hostnames
if conf and type(conf[0]) == str: