Module: check_mk
Branch: master
Commit: 510e83ef387832236e86303326baae7ce91e1962
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=510e83ef387832…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Feb 27 09:34:25 2019 +0100
7184 FIX Add missing painter for additional host addresses
The additional addresses of a host can now be added to view using the painter
"Host addresses (additional)".
Change-Id: Ica3666a2d811986d22c7668a72221e3cd60b58d6
---
.werks/7184 | 12 ++++++++++++
cmk/gui/plugins/views/painters.py | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 46 insertions(+)
diff --git a/.werks/7184 b/.werks/7184
new file mode 100644
index 0000000..18eab30
--- /dev/null
+++ b/.werks/7184
@@ -0,0 +1,12 @@
+Title: Add missing painter for additional host addresses
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1551096001
+
+The additional addresses of a host can now be added to view using the painter
+"Host addresses (additional)".
diff --git a/cmk/gui/plugins/views/painters.py b/cmk/gui/plugins/views/painters.py
index 76ef924..9a97114 100644
--- a/cmk/gui/plugins/views/painters.py
+++ b/cmk/gui/plugins/views/painters.py
@@ -2697,6 +2697,40 @@ class PainterHostAddresses(Painter):
@painter_registry.register
+class PainterHostAddresses(Painter):
+ @property
+ def ident(self):
+ return "host_addresses_additional"
+
+ @property
+ def title(self):
+ return _("Host addresses (additional)")
+
+ @property
+ def short_title(self):
+ return _("Add. addresses")
+
+ @property
+ def columns(self):
+ return ["host_custom_variable_names",
"host_custom_variable_values"]
+
+ def render(self, row, cell):
+ custom_vars = dict(
+ zip(row["host_custom_variable_names"],
row["host_custom_variable_values"]))
+
+ ipv4_addresses = custom_vars.get("ADDRESSES_4", "").strip()
+ ipv6_addresses = custom_vars.get("ADDRESSES_6", "").strip()
+
+ addresses = []
+ if ipv4_addresses:
+ addresses += ipv4_addresses.split(" ")
+ if ipv6_addresses:
+ addresses += ipv6_addresses.split(" ")
+
+ return "", ", ".join(addresses)
+
+
+(a)painter_registry.register
class PainterHostAddressFamily(Painter):
@property
def ident(self):