Module: check_mk
Branch: master
Commit: 8be8d01e254d53573445728dc0b47b89ea286f28
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8be8d01e254d53…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Mar 31 16:13:15 2016 +0200
3353 FIX Displaying disabled/offline host state in WATO host list now
---
.werks/3353 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 8 ++++++--
web/htdocs/watolib.py | 5 ++++-
4 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/.werks/3353 b/.werks/3353
new file mode 100644
index 0000000..67e30c5
--- /dev/null
+++ b/.werks/3353
@@ -0,0 +1,10 @@
+Title: Displaying disabled/offline host state in WATO host list now
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1459433588
+
+
diff --git a/ChangeLog b/ChangeLog
index 3b19951..7ac1877 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -189,6 +189,7 @@
* 3318 FIX: CSV bulk import of hosts: fix handling of CSV column headers...
* 3351 FIX: Network scan: Fixed number in hosts not being updated during network
scan
* 3352 FIX: Network scan: Added hostname translation to translate detected DNS names
of scanned hosts
+ * 3353 FIX: Displaying disabled/offline host state in WATO host list now
Notifications:
* 3263 Notifications: allow users to restrict by their contact groups...
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index adcadce..ebc075a 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -757,11 +757,15 @@ def show_hosts(folder):
html.icon(msg, "validation_error")
html.write(" ")
- html.write('<a href="%s">%s</a>\n' %
(host.edit_url(), hostname))
+ if host.is_offline():
+ html.icon(_("This host is disabled"), "disabled")
+ html.write(" ")
if host.is_cluster():
- html.write(" ")
html.icon(_("This host is a cluster of %s") % ",
".join(host.cluster_nodes()), "cluster")
+ html.write(" ")
+
+ html.write('<a href="%s">%s</a>\n' %
(host.edit_url(), hostname))
# Show attributes
for attr, topic in all_host_attributes():
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index 3e2b283..277a1a3 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -1970,11 +1970,14 @@ class Host(WithPermissionsAndAttributes):
def is_cluster(self):
return self._cluster_nodes != None
-
def cluster_nodes(self):
return self._cluster_nodes
+ def is_offline(self):
+ return self.tag("criticality") == "offline"
+
+
def site_id(self):
return self._attributes.get("site") or self.folder().site_id()